|
21 | 21 | # cython: language_level=3
|
22 | 22 | # cython: binding=True
|
23 | 23 |
|
24 |
| -from libc.stdint cimport UINT64_MAX, UINT32_MAX |
25 |
| -from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free |
26 |
| -from cpython.buffer cimport PyBUF_C_CONTIGUOUS, PyObject_GetBuffer, PyBuffer_Release |
27 |
| -from cpython.bytes cimport PyBytes_FromStringAndSize |
28 |
| - |
29 |
| -cdef extern from "<Python.h>": |
30 |
| - const Py_ssize_t PY_SSIZE_T_MAX |
31 |
| - |
32 | 24 | """
|
33 | 25 | Pythonic interface to ISA-L's igzip_lib.
|
34 | 26 |
|
35 | 27 | This module comes with the following constants:
|
36 |
| -============================== ================================================ |
37 |
| - Constant Meaning |
| 28 | +
|
38 | 29 | ============================== ================================================
|
39 | 30 | ``ISAL_BEST_SPEED`` The lowest compression level (0)
|
40 | 31 | ``ISAL_BEST_COMPRESSION`` The highest compression level (3)
|
41 | 32 | ``ISAL_DEFAULT_COMPRESSION`` The compromise compression level (2)
|
42 | 33 | ``DEF_BUF_SIZE`` Default size for the starting buffer (16K)
|
43 | 34 | ``MAX_HIST_BITS`` Maximum window size bits (15).
|
44 | 35 | ``COMP_DEFLATE`` Flag to compress to a raw deflate block
|
45 |
| -``COMP_GZIP`` Flag to compress a gzip block, consisting of a |
46 |
| - gzip header, raw deflate block and a gzip |
| 36 | +``COMP_GZIP`` Flag to compress a gzip block, consisting of a |
| 37 | + gzip header, raw deflate block and a gzip |
| 38 | + trailer. |
| 39 | +``COMP_GZIP_NO_HDR`` Flag to compress a gzip block without a header. |
| 40 | +``COMP_ZLIB`` Flag to compress a zlib block, consisting of a |
| 41 | + zlib header, a raw deflate block and a zlib |
| 42 | + trailer. |
| 43 | +``COMP_ZLIB_NO_HDR`` Flag to compress a zlib block without a header. |
| 44 | +``DECOMP_DEFLATE`` Flag to decompress a raw deflate block. |
| 45 | +``DECOMP_GZIP`` Flag to decompress a gzip block including header |
| 46 | + and verify the checksums in the trailer. |
| 47 | +``DECOMP_GZIP_NO_HDR`` Flag to decompress a gzip block without a header |
| 48 | + and verify the checksums in the trailer. |
| 49 | +``DECOMP_GZIP_NO_HDR_VER`` Flag to decompress a gzip block without a header |
| 50 | + and without verifying the checksums in the |
47 | 51 | trailer.
|
48 |
| -``COMP_GZIP_NO_HDR`` Compress |
| 52 | +``DECOMP_ZLIB`` Flag to decompress a zlib block including header |
| 53 | + and verify the checksums in the trailer. |
| 54 | +``DECOMP_ZLIB_NO_HDR`` Flag to decompress a zlib block without a header |
| 55 | + and verify the checksums in the trailer. |
| 56 | +``DECOMP_ZLIB_NO_HDR_VER`` Flag to decompress a zlib block without a header |
| 57 | + and without verifying the checksums in the |
| 58 | + trailer. |
| 59 | +``MEM_LEVEL_DEFAULT`` The default memory level for the internal level |
| 60 | + buffer. (Equivalent to |
| 61 | + MEM_LEVEL_LARGE.) |
| 62 | +``MEM_LEVEL_MIN`` The minimum memory level. |
| 63 | +``MEM_LEVEL_SMALL`` |
| 64 | +``MEM_LEVEL_MEDIUM`` |
| 65 | +``MEM_LEVEL_LARGE`` |
| 66 | +``MEM_LEVEL_EXTRA_LARGE`` The largest memory level. |
| 67 | +============================== ================================================ |
49 | 68 | """
|
| 69 | + |
| 70 | +from libc.stdint cimport UINT64_MAX, UINT32_MAX |
| 71 | +from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free |
| 72 | +from cpython.buffer cimport PyBUF_C_CONTIGUOUS, PyObject_GetBuffer, PyBuffer_Release |
| 73 | +from cpython.bytes cimport PyBytes_FromStringAndSize |
| 74 | + |
| 75 | +cdef extern from "<Python.h>": |
| 76 | + const Py_ssize_t PY_SSIZE_T_MAX |
| 77 | + |
50 | 78 | ISAL_BEST_SPEED = ISAL_DEF_MIN_LEVEL
|
51 | 79 | ISAL_BEST_COMPRESSION = ISAL_DEF_MAX_LEVEL
|
52 | 80 | cdef int ISAL_DEFAULT_COMPRESSION_I = 2
|
|
0 commit comments