summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/_iomodule.h')
-rw-r--r--Modules/_io/_iomodule.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index 0fe90a3..140f260 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -52,7 +52,12 @@ extern PyObject *_PyIncrementalNewlineDecoder_decode(
which can be safely put aside until another search.
NOTE: for performance reasons, `end` must point to a NUL character ('\0').
- Otherwise, the function will scan further and return garbage. */
+ Otherwise, the function will scan further and return garbage.
+
+ There are three modes, in order of priority:
+ * translated: Only find \n (assume newlines already translated)
+ * universal: Use universal newlines algorithm
+ * Otherwise, the line ending is specified by readnl, a str object */
extern Py_ssize_t _PyIO_find_line_ending(
int translated, int universal, PyObject *readnl,
int kind, char *start, char *end, Py_ssize_t *consumed);
@@ -77,7 +82,7 @@ extern int _PyIO_trap_eintr(void);
long with "%lld" even when both long and long long have the same
precision. */
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
/* Windows uses long long for offsets */
typedef PY_LONG_LONG Py_off_t;
@@ -135,7 +140,10 @@ typedef struct {
} _PyIO_State;
#define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod))
-#define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module))
+#define IO_STATE() _PyIO_get_module_state()
+
+extern _PyIO_State *_PyIO_get_module_state(void);
+extern PyObject *_PyIO_get_locale_module(_PyIO_State *);
extern PyObject *_PyIO_str_close;
extern PyObject *_PyIO_str_closed;