+++ /dev/null
-#ifndef Py_CSTRINGIO_H\r
-#define Py_CSTRINGIO_H\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-/*\r
-\r
- This header provides access to cStringIO objects from C.\r
- Functions are provided for calling cStringIO objects and\r
- macros are provided for testing whether you have cStringIO\r
- objects.\r
-\r
- Before calling any of the functions or macros, you must initialize\r
- the routines with:\r
-\r
- PycString_IMPORT\r
-\r
- This would typically be done in your init function.\r
-\r
-*/\r
-\r
-#define PycStringIO_CAPSULE_NAME "cStringIO.cStringIO_CAPI"\r
-\r
-#define PycString_IMPORT \\r
- PycStringIO = ((struct PycStringIO_CAPI*)PyCapsule_Import(\\r
- PycStringIO_CAPSULE_NAME, 0))\r
-\r
-/* Basic functions to manipulate cStringIO objects from C */\r
-\r
-static struct PycStringIO_CAPI {\r
-\r
- /* Read a string from an input object. If the last argument\r
- is -1, the remainder will be read.\r
- */\r
- int(*cread)(PyObject *, char **, Py_ssize_t);\r
-\r
- /* Read a line from an input object. Returns the length of the read\r
- line as an int and a pointer inside the object buffer as char** (so\r
- the caller doesn't have to provide its own buffer as destination).\r
- */\r
- int(*creadline)(PyObject *, char **);\r
-\r
- /* Write a string to an output object*/\r
- int(*cwrite)(PyObject *, const char *, Py_ssize_t);\r
-\r
- /* Get the output object as a Python string (returns new reference). */\r
- PyObject *(*cgetvalue)(PyObject *);\r
-\r
- /* Create a new output object */\r
- PyObject *(*NewOutput)(int);\r
-\r
- /* Create an input object from a Python string\r
- (copies the Python string reference).\r
- */\r
- PyObject *(*NewInput)(PyObject *);\r
-\r
- /* The Python types for cStringIO input and output objects.\r
- Note that you can do input on an output object.\r
- */\r
- PyTypeObject *InputType, *OutputType;\r
-\r
-} *PycStringIO;\r
-\r
-/* These can be used to test if you have one */\r
-#define PycStringIO_InputCheck(O) \\r
- (Py_TYPE(O)==PycStringIO->InputType)\r
-#define PycStringIO_OutputCheck(O) \\r
- (Py_TYPE(O)==PycStringIO->OutputType)\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* !Py_CSTRINGIO_H */\r