| 1 |
|
|---|
| 2 | /* File object interface */
|
|---|
| 3 |
|
|---|
| 4 | #ifndef Py_FILEOBJECT_H
|
|---|
| 5 | #define Py_FILEOBJECT_H
|
|---|
| 6 | #ifdef __cplusplus
|
|---|
| 7 | extern "C" {
|
|---|
| 8 | #endif
|
|---|
| 9 |
|
|---|
| 10 | typedef struct {
|
|---|
| 11 | PyObject_HEAD
|
|---|
| 12 | FILE *f_fp;
|
|---|
| 13 | PyObject *f_name;
|
|---|
| 14 | PyObject *f_mode;
|
|---|
| 15 | int (*f_close)(FILE *);
|
|---|
| 16 | int f_softspace; /* Flag used by 'print' command */
|
|---|
| 17 | int f_binary; /* Flag which indicates whether the file is
|
|---|
| 18 | open in binary (1) or text (0) mode */
|
|---|
| 19 | char* f_buf; /* Allocated readahead buffer */
|
|---|
| 20 | char* f_bufend; /* Points after last occupied position */
|
|---|
| 21 | char* f_bufptr; /* Current buffer position */
|
|---|
|
|---|