1
#ifndef LIBLZMA_OPTIONS_H
2
#define LIBLZMA_OPTIONS_H 1
5
#include <structmember.h>
7
#define CHECK_RANGE(x, a, b, msg) if (check_range(x, a, b)) { PyErr_Format(PyExc_ValueError, msg, a, b, (int32_t)x); ret = false; goto end; }
8
static inline bool check_range(uint32_t x, uint32_t a, uint32_t b){
9
return (x < a || x > b);
11
#define MEMBER_DESCRIPTOR(name, type, variable, text) (PyMemberDef){name, type, offsetof(LZMAOptionsObject, variable), RO, PyString_AsString(PyString_Format(PyString_FromString((char*)text), (PyObject*)self->variable))}
13
#define LZMA_BEST_SPEED 0
14
#define LZMA_BEST_COMPRESSION 9
15
#define LZMA_MODE_DEFAULT LZMA_MODE_NORMAL
16
#define LZMA_MODE_INVALID -1
17
#define LZMA_MF_INVALID -1
19
#define LZMA_MF_DEFAULT LZMA_MF_BT4
20
#define LZMA_MF_CYCLES_DEFAULT 0
21
#define LZMA_DICT_SIZE_MAX (UINT32_C(1) << 30) + (UINT32_C(1) << 29)
22
#define LZMA_NICE_LEN_MIN 5
23
#define LZMA_NICE_LEN_MAX 273
24
#define LZMA_NICE_LEN_DEFAULT 128
44
extern PyTypeObject LZMAOptions_Type;
46
bool init_lzma_options(const char *funcName, PyObject *kwargs, lzma_filter *filters);
47
PyObject *LZMA_options_get(lzma_filter filter);
49
#define DEFAULT_OPTIONS_STRING "options={'format':'xz', 'check':'crc32', 'level':6, 'extreme':False,\n\
50
'dictionary_size':23, 'literal_contextbits':3 'literal_pos_bits':0, 'pos_bits':2, 'mode':2,\n\
51
'fast_bytes':128, 'match_finder':'bt4', 'match_finder_cycles':0"
52
#endif /* LIBLZMA_OPTIONS_H */