| 1 | /* Low level interface to the Zstandard algorithm & the zstd library. */ |
| 2 | |
| 3 | #ifndef ZSTD_DICT_H |
| 4 | #define ZSTD_DICT_H |
| 5 | |
| 6 | #include "backports_zstd_edits.h" |
| 7 | |
| 8 | #include <zstd.h> // ZSTD_DDict |
| 9 | |
| 10 | typedef struct { |
| 11 | PyObject_HEAD |
| 12 | |
| 13 | /* Reusable compress/decompress dictionary, they are created once and |
| 14 | can be shared by multiple threads concurrently, since its usage is |
| 15 | read-only. |
| 16 | c_dicts is a dict, int(compressionLevel):PyCapsule(ZSTD_CDict*) */ |
| 17 | ZSTD_DDict *d_dict; |
| 18 | PyObject *c_dicts; |
| 19 | |
| 20 | /* Dictionary content. */ |
| 21 | char *dict_buffer; |
| 22 | Py_ssize_t dict_len; |
| 23 | |
| 24 | /* Dictionary id */ |
| 25 | uint32_t dict_id; |
| 26 | |
| 27 | /* Lock to protect the digested dictionaries */ |
| 28 | BACKPORTSZSTD_LOCK lock; |
| 29 | } ZstdDict; |
| 30 | |
| 31 | #endif // !ZSTD_DICT_H |