1 /* File object interface (what's left of it -- see io.py) */
2 
3 #ifndef Py_FILEOBJECT_H
4 #define Py_FILEOBJECT_H
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 #define PY_STDIOTEXTMODE "b"
10 
11 PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int,
12                                      const char *, const char *,
13                                      const char *, int);
14 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
15 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
16 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
17 PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
18 #ifndef Py_LIMITED_API
19 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
20 #endif
21 
22 /* The default encoding used by the platform file system APIs
23    If non-NULL, this is different than the default encoding for strings
24 */
25 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
26 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
27 PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
28 #endif
29 PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
30 
31 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
32 PyAPI_DATA(int) Py_UTF8Mode;
33 #endif
34 
35 /* Internal API
36 
37    The std printer acts as a preliminary sys.stderr until the new io
38    infrastructure is in place. */
39 #ifndef Py_LIMITED_API
40 PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
41 PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
42 #endif /* Py_LIMITED_API */
43 
44 /* A routine to check if a file descriptor can be select()-ed. */
45 #ifdef _MSC_VER
46     /* On Windows, any socket fd can be select()-ed, no matter how high */
47     #define _PyIsSelectable_fd(FD) (1)
48 #else
49     #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
50 #endif
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif /* !Py_FILEOBJECT_H */
56