From: Martin v. Löwis Date: Fri, 15 Mar 2002 17:42:16 +0000 (+0000) Subject: Patch #530105: Allow file object may to be subtyped X-Git-Tag: v2.3c1~6480 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6eebbb4358d8749d5800814bab8c4cf3f068fbc;p=python Patch #530105: Allow file object may to be subtyped --- diff --git a/Include/fileobject.h b/Include/fileobject.h index 632c436c33..0876cd29a8 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -7,6 +7,17 @@ extern "C" { #endif +typedef struct { + PyObject_HEAD + FILE *f_fp; + PyObject *f_name; + PyObject *f_mode; + int (*f_close)(FILE *); + int f_softspace; /* Flag used by 'print' command */ + int f_binary; /* Flag which indicates whether the file is + open in binary (1) or test (0) mode */ +} PyFileObject; + extern DL_IMPORT(PyTypeObject) PyFile_Type; #define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 7bcc82aa1c..c8fb214e2f 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -38,17 +38,6 @@ #endif -typedef struct { - PyObject_HEAD - FILE *f_fp; - PyObject *f_name; - PyObject *f_mode; - int (*f_close)(FILE *); - int f_softspace; /* Flag used by 'print' command */ - int f_binary; /* Flag which indicates whether the file is open - open in binary (1) or test (0) mode */ -} PyFileObject; - FILE * PyFile_AsFile(PyObject *f) {