source: vendor/python/2.5/Include/cStringIO.h@ 3232

Last change on this file since 3232 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 2.0 KB
Line 
1#ifndef Py_CSTRINGIO_H
2#define Py_CSTRINGIO_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6/*
7
8 This header provides access to cStringIO objects from C.
9 Functions are provided for calling cStringIO objects and
10 macros are provided for testing whether you have cStringIO
11 objects.
12
13 Before calling any of the functions or macros, you must initialize
14 the routines with:
15
16 PycString_IMPORT
17
18 This would typically be done in your init function.
19
20*/
21#define PycString_IMPORT \
22 PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", \
23 "cStringIO_CAPI")
24
25/* Basic functions to manipulate cStringIO objects from C */
26
27static struct PycStringIO_CAPI {
28
29 /* Read a string from an input object. If the last argument
30 is -1, the remainder will be read.
31 */
32 int(*cread)(PyObject *, char **, Py_ssize_t);
33
34 /* Read a line from an input object. Returns the length of the read
35 line as an int and a pointer inside the object buffer as char** (so
36 the caller doesn't have to provide its own buffer as destination).
37 */
38 int(*creadline)(PyObject *, char **);
39