Merged revisions 81656 via svnmerge from
[python/dscho.git] / Include / fileobject.h
blob6e0e55e3eec4a6d0241c3fe3248e3b7da7945fd4
1 /* File object interface (what's left of it -- see io.py) */
3 #ifndef Py_FILEOBJECT_H
4 #define Py_FILEOBJECT_H
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
9 #define PY_STDIOTEXTMODE "b"
11 PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *,
12 char *, int);
13 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
14 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
15 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
16 PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
17 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
19 /* The default encoding used by the platform file system APIs
20 If non-NULL, this is different than the default encoding for strings
22 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
23 PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
24 PyAPI_FUNC(int) _Py_SetFileSystemEncoding(PyObject *);
26 /* Internal API
28 The std printer acts as a preliminary sys.stderr until the new io
29 infrastructure is in place. */
30 PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
31 PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
33 #if defined _MSC_VER && _MSC_VER >= 1400
34 /* A routine to check if a file descriptor is valid on Windows. Returns 0
35 * and sets errno to EBADF if it isn't. This is to avoid Assertions
36 * from various functions in the Windows CRT beginning with
37 * Visual Studio 2005
39 int _PyVerify_fd(int fd);
40 #else
41 #define _PyVerify_fd(A) (1) /* dummy */
42 #endif
44 #ifdef __cplusplus
46 #endif
47 #endif /* !Py_FILEOBJECT_H */