#include "Python.h"
#include "pycore_call.h"
#include "pycore_runtime.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER)
#define GETC(f) …
#define FLOCKFILE(f) …
#define FUNLOCKFILE(f) …
#else
#define GETC …
#define FLOCKFILE …
#define FUNLOCKFILE …
#endif
#define NEWLINE_UNKNOWN …
#define NEWLINE_CR …
#define NEWLINE_LF …
#define NEWLINE_CRLF …
PyObject *
PyFile_FromFd(int fd, const char *name, const char *mode, int buffering, const char *encoding,
const char *errors, const char *newline, int closefd)
{ … }
PyObject *
PyFile_GetLine(PyObject *f, int n)
{ … }
int
PyFile_WriteObject(PyObject *v, PyObject *f, int flags)
{ … }
int
PyFile_WriteString(const char *s, PyObject *f)
{ … }
int
PyObject_AsFileDescriptor(PyObject *o)
{ … }
int
_PyLong_FileDescriptor_Converter(PyObject *o, void *ptr)
{ … }
char *
_Py_UniversalNewlineFgetsWithSize(char *buf, int n, FILE *stream, PyObject *fobj, size_t* size)
{ … }
char *
Py_UniversalNewlineFgets(char *buf, int n, FILE *stream, PyObject *fobj) { … }
PyStdPrinter_Object;
PyObject *
PyFile_NewStdPrinter(int fd)
{ … }
static PyObject *
stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
{ … }
static PyObject *
stdprinter_fileno(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
{ … }
static PyObject *
stdprinter_repr(PyStdPrinter_Object *self)
{ … }
static PyObject *
stdprinter_noop(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
{ … }
static PyObject *
stdprinter_isatty(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
{ … }
static PyMethodDef stdprinter_methods[] = …;
static PyObject *
get_closed(PyStdPrinter_Object *self, void *closure)
{ … }
static PyObject *
get_mode(PyStdPrinter_Object *self, void *closure)
{ … }
static PyObject *
get_encoding(PyStdPrinter_Object *self, void *closure)
{ … }
static PyGetSetDef stdprinter_getsetlist[] = …;
PyTypeObject PyStdPrinter_Type = …;
int
PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData) { … }
PyObject *
PyFile_OpenCodeObject(PyObject *path)
{ … }
PyObject *
PyFile_OpenCode(const char *utf8path)
{ … }
int
_PyFile_Flush(PyObject *file)
{ … }