jpayne@69: /* File object interface (what's left of it -- see io.py) */ jpayne@69: jpayne@69: #ifndef Py_FILEOBJECT_H jpayne@69: #define Py_FILEOBJECT_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: #define PY_STDIOTEXTMODE "b" jpayne@69: jpayne@69: PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int, jpayne@69: const char *, const char *, jpayne@69: const char *, int); jpayne@69: PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); jpayne@69: PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); jpayne@69: PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); jpayne@69: PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); jpayne@69: jpayne@69: /* The default encoding used by the platform file system APIs jpayne@69: If non-NULL, this is different than the default encoding for strings jpayne@69: */ jpayne@69: PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; jpayne@69: PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding; jpayne@69: jpayne@69: /* A routine to check if a file descriptor can be select()-ed. */ jpayne@69: #ifdef _MSC_VER jpayne@69: /* On Windows, any socket fd can be select()-ed, no matter how high */ jpayne@69: #define _PyIsSelectable_fd(FD) (1) jpayne@69: #else jpayne@69: #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE) jpayne@69: #endif jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: # define Py_CPYTHON_FILEOBJECT_H jpayne@69: # include "cpython/fileobject.h" jpayne@69: # undef Py_CPYTHON_FILEOBJECT_H jpayne@69: #endif jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_FILEOBJECT_H */