diff options
author | Evgenii Kliuchnikov <eustas.ru@gmail.com> | 2022-11-17 13:03:09 +0000 |
---|---|---|
committer | Evgenii Kliuchnikov <eustas.ru@gmail.com> | 2022-11-17 13:03:09 +0000 |
commit | a8f5813b843b7ec469dbd3d8a6a8743395359964 (patch) | |
tree | e349a984eac9404db22a662e579fe47953dc47fe /python | |
parent | 388d0d53fb29271492537015beeed91b74076411 (diff) | |
download | brotli-a8f5813b843b7ec469dbd3d8a6a8743395359964.zip brotli-a8f5813b843b7ec469dbd3d8a6a8743395359964.tar.gz brotli-a8f5813b843b7ec469dbd3d8a6a8743395359964.tar.bz2 |
Update
Documentation:
- add note that brotli is a "stream" format, not an archive-like
- regenerate .1 with Pandoc
Build:
- drop legacy "BROTLI_BUILD_PORTABLE" option
- drop "BROTLI_SANITIZED" definition
Code:
- c: comb includes
- c/enc: extract encoder state into separate header
- c/enc: drop designated q10 codepath
- c/enc: dealing better with flushing of empty stream
- fix MSVC compilation
API:
- py: use library version instead of one in version.h
- c: add plugable API to report consumed input / produced output
- c/java: support "lean" prepared dictionaries (without copy of source)
Diffstat (limited to 'python')
-rw-r--r-- | python/_brotli.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/_brotli.cc b/python/_brotli.cc index d4075bd..54c7363 100644 --- a/python/_brotli.cc +++ b/python/_brotli.cc @@ -2,11 +2,12 @@ #include <Python.h> #include <bytesobject.h> #include <structmember.h> -#include <vector> -#include "../common/version.h" + #include <brotli/decode.h> #include <brotli/encode.h> +#include <vector> + #if PY_MAJOR_VERSION >= 3 #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong @@ -745,8 +746,9 @@ PyMODINIT_FUNC INIT_BROTLI(void) { PyModule_AddIntConstant(m, "MODE_FONT", (int) BROTLI_MODE_FONT); char version[16]; + uint32_t decoderVersion = BrotliDecoderVersion(); snprintf(version, sizeof(version), "%d.%d.%d", - BROTLI_VERSION >> 24, (BROTLI_VERSION >> 12) & 0xFFF, BROTLI_VERSION & 0xFFF); + decoderVersion >> 24, (decoderVersion >> 12) & 0xFFF, decoderVersion & 0xFFF); PyModule_AddStringConstant(m, "__version__", version); RETURN_BROTLI; |