Mercurial > public > mercurial-scm > hg
diff contrib/python-zstandard/c-ext/python-zstandard.h @ 42070:675775c33ab6
zstandard: vendor python-zstandard 0.11
The upstream source distribution from PyPI was extracted. Unwanted
files were removed.
The clang-format ignore list was updated to reflect the new source
of files.
The project contains a vendored copy of zstandard 1.3.8. The old
version was 1.3.6. This should result in some minor performance wins.
test-check-py3-compat.t was updated to reflect now-passing tests on
Python 3.8.
Some HTTP tests were updated to reflect new zstd compression output.
# no-check-commit because 3rd party code has different style guidelines
Differential Revision: https://phab.mercurial-scm.org/D6199
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 04 Apr 2019 17:34:43 -0700 |
parents | 73fef626dae3 |
children | 69de49c4e39c |
line wrap: on
line diff
--- a/contrib/python-zstandard/c-ext/python-zstandard.h Thu Apr 04 15:24:03 2019 -0700 +++ b/contrib/python-zstandard/c-ext/python-zstandard.h Thu Apr 04 17:34:43 2019 -0700 @@ -16,7 +16,7 @@ #include <zdict.h> /* Remember to change the string in zstandard/__init__ as well */ -#define PYTHON_ZSTANDARD_VERSION "0.10.1" +#define PYTHON_ZSTANDARD_VERSION "0.11.0" typedef enum { compressorobj_flush_finish, @@ -31,27 +31,6 @@ typedef struct { PyObject_HEAD ZSTD_CCtx_params* params; - unsigned format; - int compressionLevel; - unsigned windowLog; - unsigned hashLog; - unsigned chainLog; - unsigned searchLog; - unsigned minMatch; - unsigned targetLength; - unsigned compressionStrategy; - unsigned contentSizeFlag; - unsigned checksumFlag; - unsigned dictIDFlag; - unsigned threads; - unsigned jobSize; - unsigned overlapSizeLog; - unsigned forceMaxWindow; - unsigned enableLongDistanceMatching; - unsigned ldmHashLog; - unsigned ldmMinMatch; - unsigned ldmBucketSizeLog; - unsigned ldmHashEveryLog; } ZstdCompressionParametersObject; extern PyTypeObject ZstdCompressionParametersType; @@ -129,9 +108,11 @@ ZstdCompressor* compressor; PyObject* writer; - unsigned long long sourceSize; + ZSTD_outBuffer output; size_t outSize; int entered; + int closed; + int writeReturnRead; unsigned long long bytesCompressed; } ZstdCompressionWriter; @@ -235,6 +216,8 @@ PyObject* reader; /* Size for read() operations on reader. */ size_t readSize; + /* Whether a read() can return data spanning multiple zstd frames. */ + int readAcrossFrames; /* Buffer to read from (if reading from a buffer). */ Py_buffer buffer; @@ -267,6 +250,8 @@ PyObject* writer; size_t outSize; int entered; + int closed; + int writeReturnRead; } ZstdDecompressionWriter; extern PyTypeObject ZstdDecompressionWriterType; @@ -360,8 +345,9 @@ extern PyTypeObject ZstdBufferWithSegmentsCollectionType; -int set_parameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, unsigned value); +int set_parameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value); int set_parameters(ZSTD_CCtx_params* params, ZstdCompressionParametersObject* obj); +int to_cparams(ZstdCompressionParametersObject* params, ZSTD_compressionParameters* cparams); FrameParametersObject* get_frame_parameters(PyObject* self, PyObject* args, PyObject* kwargs); int ensure_ddict(ZstdCompressionDict* dict); int ensure_dctx(ZstdDecompressor* decompressor, int loadDict);