1
#ifndef LIBLZMA_FILEOBJ_H
2
#define LIBLZMA_FILEOBJ_H 1
5
#include "liblzma_file.h"
6
#include <structmember.h>
8
/* Our very own off_t-like type, 64-bit if possible */
9
/* copied from Objects/fileobject.c */
10
#if !defined(HAVE_LARGEFILE_SUPPORT)
11
typedef off_t Py_off_t;
12
#elif SIZEOF_OFF_T >= 8
13
typedef off_t Py_off_t;
14
#elif SIZEOF_FPOS_T >= 8
15
typedef fpos_t Py_off_t;
17
#error "Large file support, but neither off_t nor fpos_t is large enough."
20
#define BUF(v) PyString_AS_STRING((PyStringObject *)v)
22
typedef enum file_mode_e {
29
#define LZMAFileObject_Check(v) (Py_TYPE(v) == &LZMAFile_Type)
35
char* f_buf; /* Allocated readahead buffer */
36
char* f_bufend; /* Points after last occupied position */
37
char* f_bufptr; /* Current buffer position */
39
int f_softspace; /* Flag used by 'print' command */
41
bool f_univ_newline; /* Handle any newline convention */
42
int f_newlinetypes; /* Types of newlines seen */
43
bool f_skipnextlf; /* Skip next \n */
46
lzma_options_lzma options;
47
lzma_filter filters[LZMA_FILTERS_MAX + 2];
54
PyThread_type_lock lock;
58
extern PyTypeObject LZMAFile_Type;
60
#endif /* LIBLZMA_FILEOBJ_H */