~ubuntu-branches/ubuntu/utopic/python-lzma/utopic

« back to all changes in this revision

Viewing changes to liblzma_options.h

  • Committer: Bazaar Package Importer
  • Author(s): Richard Darst
  • Date: 2010-04-19 14:16:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100419141648-qwz3nm7shemqp37n
Tags: 0.5.3-1
* New upstream version
* Upgrade to 3.0 (quilt) just to be able to use .orig.tar.bz2
* Bump standards-version to 3.8.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef LIBLZMA_OPTIONS_H
2
 
#define LIBLZMA_OPTIONS_H 1
3
 
 
4
 
#include "liblzma.h"
5
 
#include <structmember.h>
6
 
 
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);
10
 
}
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))}
12
 
 
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
18
 
 
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
25
 
 
26
 
typedef struct
27
 
{
28
 
        PyObject_HEAD
29
 
        PyObject *format,
30
 
                 *check,
31
 
                 *level,
32
 
                 *dict_size,
33
 
                 *lc,
34
 
                 *lp,
35
 
                 *pb,
36
 
                 *mode_dict,
37
 
                 *mode,
38
 
                 *nice_len,
39
 
                 *mf_dict,
40
 
                 *mf,
41
 
                 *depth;
42
 
} LZMAOptionsObject;
43
 
 
44
 
extern PyTypeObject LZMAOptions_Type;
45
 
 
46
 
bool init_lzma_options(const char *funcName, PyObject *kwargs, lzma_filter *filters);
47
 
PyObject *LZMA_options_get(lzma_filter filter);
48
 
 
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 */