PycStringIO_CAPI

Basic functions to manipulate cStringIO objects from C Availability: 2.*

Members

Variables

InputType
PyTypeObject* InputType;

The Python types for cStringIO input and output objects. Note that you can do input on an output object.

NewInput
PyObject* function(PyObject*) NewInput;

Create an input object from a Python string (copies the Python string reference).

NewOutput
PyObject* function(int) NewOutput;

Create a new output object

OutputType
PyTypeObject* OutputType;

The Python types for cStringIO input and output objects. Note that you can do input on an output object.

cgetvalue
PyObject* function(PyObject*) cgetvalue;

Get the output object as a Python string (returns new reference).

cread
int function(PyObject*, char**, Py_ssize_t) cread;

Read a string from an input object. If the last argument is -1, the remainder will be read.

creadline
int function(PyObject*, char**) creadline;

Read a line from an input object. Returns the length of the read line as an int and a pointer inside the object buffer as char** (so the caller doesn't have to provide its own buffer as destination).

cwrite
int function(PyObject*, const(char)*, Py_ssize_t) cwrite;

Write a string to an output object

Meta