• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
19 /* The default encoding used by the platform file system APIs
20    If non-NULL, this is different than the default encoding for strings
21 */
22 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
23 PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
24 
25 /* A routine to check if a file descriptor can be select()-ed. */
26 #ifdef _MSC_VER
27     /* On Windows, any socket fd can be select()-ed, no matter how high */
28     #define _PyIsSelectable_fd(FD) (1)
29 #else
30     #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
31 #endif
32 
33 #ifndef Py_LIMITED_API
34 #  define Py_CPYTHON_FILEOBJECT_H
35 #  include  "cpython/fileobject.h"
36 #  undef Py_CPYTHON_FILEOBJECT_H
37 #endif
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 #endif /* !Py_FILEOBJECT_H */
43