Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / include / python2.4 / fileobject.h
CommitLineData
86530b38
AT
1#ifndef Py_FILEOBJECT_H
2#define Py_FILEOBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7typedef struct {
8 PyObject_HEAD
9 FILE *f_fp;
10 PyObject *f_name;
11 PyObject *f_mode;
12 int (*f_close)(FILE *);
13 int f_softspace; /* Flag used by 'print' command */
14 int f_binary; /* Flag which indicates whether the file is
15 open in binary (1) or text (0) mode */
16 char* f_buf; /* Allocated readahead buffer */
17 char* f_bufend; /* Points after last occupied position */
18 char* f_bufptr; /* Current buffer position */
19 char *f_setbuf; /* Buffer for setbuf(3) and setvbuf(3) */
20 int f_univ_newline; /* Handle any newline convention */
21 int f_newlinetypes; /* Types of newlines seen */
22 int f_skipnextlf; /* Skip next \n */
23 PyObject *f_encoding;
24 PyObject *weakreflist; /* List of weak references */
25} PyFileObject;
26
27PyAPI_DATA(PyTypeObject) PyFile_Type;
28
29#define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type)
30#define PyFile_CheckExact(op) ((op)->ob_type == &PyFile_Type)
31
32PyAPI_FUNC(PyObject *) PyFile_FromString(char *, char *);
33PyAPI_FUNC(void) PyFile_SetBufSize(PyObject *, int);
34PyAPI_FUNC(int) PyFile_SetEncoding(PyObject *, const char *);
35PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, char *, char *,
36 int (*)(FILE *));
37PyAPI_FUNC(FILE *) PyFile_AsFile(PyObject *);
38PyAPI_FUNC(PyObject *) PyFile_Name(PyObject *);
39PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
40PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
41PyAPI_FUNC(int) PyFile_SoftSpace(PyObject *, int);
42PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
43PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
44
45/* The default encoding used by the platform file system APIs
46 If non-NULL, this is different than the default encoding for strings
47*/
48PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
49
50/* Routines to replace fread() and fgets() which accept any of \r, \n
51 or \r\n as line terminators.
52*/
53#define PY_STDIOTEXTMODE "b"
54char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
55size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *);
56
57#ifdef __cplusplus
58}
59#endif
60#endif /* !Py_FILEOBJECT_H */