Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
allendowney
GitHub Repository: allendowney/cpython
Path: blob/main/Include/fileobject.h
12 views
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
Py_DEPRECATED(3.12) PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
23
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
24
Py_DEPRECATED(3.12) PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
25
#endif
26
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
27
28
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
29
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UTF8Mode;
30
#endif
31
32
/* A routine to check if a file descriptor can be select()-ed. */
33
#ifdef _MSC_VER
34
/* On Windows, any socket fd can be select()-ed, no matter how high */
35
#define _PyIsSelectable_fd(FD) (1)
36
#else
37
#define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
38
#endif
39
40
#ifndef Py_LIMITED_API
41
# define Py_CPYTHON_FILEOBJECT_H
42
# include "cpython/fileobject.h"
43
# undef Py_CPYTHON_FILEOBJECT_H
44
#endif
45
46
#ifdef __cplusplus
47
}
48
#endif
49
#endif /* !Py_FILEOBJECT_H */
50
51