| 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 <zstd.h> // ZSTD_DDict |
| 7 |
|
| 8 |
typedef struct { |
| 9 |
PyObject_HEAD |
| 10 |
|
| 11 |
/* Reusable compress/decompress dictionary, they are created once and |
| 12 |
can be shared by multiple threads concurrently, since its usage is |
| 13 |
read-only. |
| 14 |
c_dicts is a dict, int(compressionLevel):PyCapsule(ZSTD_CDict*) */ |
| 15 |
ZSTD_DDict *d_dict; |
| 16 |
PyObject *c_dicts; |
| 17 |
|
| 18 |
/* Dictionary content. */ |
| 19 |
char *dict_buffer; |
| 20 |
Py_ssize_t dict_len; |
| 21 |
|
| 22 |
/* Dictionary id */ |
| 23 |
uint32_t dict_id; |
| 24 |
|
| 25 |
/* Lock to protect the digested dictionaries */ |
| 26 |
PyMutex lock; |
| 27 |
} ZstdDict; |
| 28 |
|
| 29 |
#endif // !ZSTD_DICT_H |