| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
extern PyTypeObject PyIOBase_Type; |
| 7 |
extern PyTypeObject PyRawIOBase_Type; |
| 8 |
extern PyTypeObject PyBufferedIOBase_Type; |
| 9 |
extern PyTypeObject PyTextIOBase_Type; |
| 10 |
|
| 11 |
|
| 12 |
extern PyTypeObject PyFileIO_Type; |
| 13 |
extern PyTypeObject PyBytesIO_Type; |
| 14 |
extern PyTypeObject PyStringIO_Type; |
| 15 |
extern PyTypeObject PyBufferedReader_Type; |
| 16 |
extern PyTypeObject PyBufferedWriter_Type; |
| 17 |
extern PyTypeObject PyBufferedRWPair_Type; |
| 18 |
extern PyTypeObject PyBufferedRandom_Type; |
| 19 |
extern PyTypeObject PyTextIOWrapper_Type; |
| 20 |
extern PyTypeObject PyIncrementalNewlineDecoder_Type; |
| 21 |
|
| 22 |
|
| 23 |
extern int _PyIO_ConvertSsize_t(PyObject *, void *); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
extern PyObject* _PyIOBase_check_readable(PyObject *self, PyObject *args); |
| 30 |
extern PyObject* _PyIOBase_check_writable(PyObject *self, PyObject *args); |
| 31 |
extern PyObject* _PyIOBase_check_seekable(PyObject *self, PyObject *args); |
| 32 |
extern PyObject* _PyIOBase_check_closed(PyObject *self, PyObject *args); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
extern int _PyIOBase_finalize(PyObject *self); |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
extern int _PyFileIO_closed(PyObject *self); |
| 43 |
|
| 44 |
|
| 45 |
extern PyObject *_PyIncrementalNewlineDecoder_decode( |
| 46 |
PyObject *self, PyObject *input, int final); |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
extern Py_ssize_t _PyIO_find_line_ending( |
| 62 |
int translated, int universal, PyObject *readnl, |
| 63 |
Py_UNICODE *start, Py_UNICODE *end, Py_ssize_t *consumed); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
extern int _PyIO_trap_eintr(void); |
| 70 |
|
| 71 |
#define DEFAULT_BUFFER_SIZE (8 * 1024) |
| 72 |
|
| 73 |
typedef struct { |
| 74 |
|
| 75 |
PyObject_HEAD |
| 76 |
PyObject *dict; |
| 77 |
PyObject *args; |
| 78 |
PyObject *message; |
| 79 |
|
| 80 |
PyObject *myerrno; |
| 81 |
PyObject *strerror; |
| 82 |
PyObject *filename; |
| 83 |
Py_ssize_t written; |
| 84 |
} PyBlockingIOErrorObject; |
| 85 |
extern PyObject *PyExc_BlockingIOError; |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
#if defined(MS_WIN64) || defined(MS_WINDOWS) |
| 100 |
|
| 101 |
|
| 102 |
typedef PY_LONG_LONG Py_off_t; |
| 103 |
# define PyLong_AsOff_t PyLong_AsLongLong |
| 104 |
# define PyLong_FromOff_t PyLong_FromLongLong |
| 105 |
# define PY_OFF_T_MAX PY_LLONG_MAX |
| 106 |
# define PY_OFF_T_MIN PY_LLONG_MIN |
| 107 |
# define PY_OFF_T_COMPAT PY_LONG_LONG |
| 108 |
# define PY_PRIdOFF "lld" |
| 109 |
|
| 110 |
#else |
| 111 |
|
| 112 |
|
| 113 |
typedef off_t Py_off_t; |
| 114 |
#if (SIZEOF_OFF_T == SIZEOF_SIZE_T) |
| 115 |
# define PyLong_AsOff_t PyLong_AsSsize_t |
| 116 |
# define PyLong_FromOff_t PyLong_FromSsize_t |
| 117 |
# define PY_OFF_T_MAX PY_SSIZE_T_MAX |
| 118 |
# define PY_OFF_T_MIN PY_SSIZE_T_MIN |
| 119 |
# define PY_OFF_T_COMPAT Py_ssize_t |
| 120 |
# define PY_PRIdOFF "zd" |
| 121 |
#elif (HAVE_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG) |
| 122 |
# define PyLong_AsOff_t PyLong_AsLongLong |
| 123 |
# define PyLong_FromOff_t PyLong_FromLongLong |
| 124 |
# define PY_OFF_T_MAX PY_LLONG_MAX |
| 125 |
# define PY_OFF_T_MIN PY_LLONG_MIN |
| 126 |
# define PY_OFF_T_COMPAT PY_LONG_LONG |
| 127 |
# define PY_PRIdOFF "lld" |
| 128 |
#elif (SIZEOF_OFF_T == SIZEOF_LONG) |
| 129 |
# define PyLong_AsOff_t PyLong_AsLong |
| 130 |
# define PyLong_FromOff_t PyLong_FromLong |
| 131 |
# define PY_OFF_T_MAX LONG_MAX |
| 132 |
# define PY_OFF_T_MIN LONG_MIN |
| 133 |
# define PY_OFF_T_COMPAT long |
| 134 |
# define PY_PRIdOFF "ld" |
| 135 |
#else |
| 136 |
# error off_t does not match either size_t, long, or long long! |
| 137 |
#endif |
| 138 |
|
| 139 |
#endif |
| 140 |
|
| 141 |
extern Py_off_t PyNumber_AsOff_t(PyObject *item, PyObject *err); |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
extern PyObject *_PyIO_os_module; |
| 146 |
extern PyObject *_PyIO_locale_module; |
| 147 |
extern PyObject *_PyIO_unsupported_operation; |
| 148 |
|
| 149 |
extern PyObject *_PyIO_str_close; |
| 150 |
extern PyObject *_PyIO_str_closed; |
| 151 |
extern PyObject *_PyIO_str_decode; |
| 152 |
extern PyObject *_PyIO_str_encode; |
| 153 |
extern PyObject *_PyIO_str_fileno; |
| 154 |
extern PyObject *_PyIO_str_flush; |
| 155 |
extern PyObject *_PyIO_str_getstate; |
| 156 |
extern PyObject *_PyIO_str_isatty; |
| 157 |
extern PyObject *_PyIO_str_newlines; |
| 158 |
extern PyObject *_PyIO_str_nl; |
| 159 |
extern PyObject *_PyIO_str_read; |
| 160 |
extern PyObject *_PyIO_str_read1; |
| 161 |
extern PyObject *_PyIO_str_readable; |
| 162 |
extern PyObject *_PyIO_str_readinto; |
| 163 |
extern PyObject *_PyIO_str_readline; |
| 164 |
extern PyObject *_PyIO_str_reset; |
| 165 |
extern PyObject *_PyIO_str_seek; |
| 166 |
extern PyObject *_PyIO_str_seekable; |
| 167 |
extern PyObject *_PyIO_str_setstate; |
| 168 |
extern PyObject *_PyIO_str_tell; |
| 169 |
extern PyObject *_PyIO_str_truncate; |
| 170 |
extern PyObject *_PyIO_str_writable; |
| 171 |
extern PyObject *_PyIO_str_write; |
| 172 |
|
| 173 |
extern PyObject *_PyIO_empty_str; |
| 174 |
extern PyObject *_PyIO_empty_bytes; |
| 175 |
extern PyObject *_PyIO_zero; |