annotate Include/cStringIO.h @ 26615:02785248e00a legacy-trunk

Typo fix.
author Greg Ward <gward@python.net>
date Thu, 12 Dec 2002 17:35:45 +0000
parents 36124157b317
children 7039375226a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25554
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24580
diff changeset
1 #ifndef Py_CSTRINGIO_H
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24580
diff changeset
2 #define Py_CSTRINGIO_H
22688
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
3 #ifdef __cplusplus
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
4 extern "C" {
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
5 #endif
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 /*
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 This header provides access to cStringIO objects from C.
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 Functions are provided for calling cStringIO objects and
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 macros are provided for testing whether you have cStringIO
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 objects.
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
12
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 Before calling any of the functions or macros, you must initialize
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 the routines with:
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
15
9944
396a38ea9b84 There's a macro PycString_IMPORT which the documentation listed as
Guido van Rossum <guido@python.org>
parents: 9605
diff changeset
16 PycString_IMPORT
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
17
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 This would typically be done in your init function.
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
19
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 */
24580
ca20be24381f Remove function definition from cStringIO.h.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 22805
diff changeset
21 #define PycString_IMPORT \
ca20be24381f Remove function definition from cStringIO.h.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 22805
diff changeset
22 PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", \
ca20be24381f Remove function definition from cStringIO.h.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 22805
diff changeset
23 "cStringIO_CAPI")
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
13620
5b727ab37092 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
Thomas Wouters <thomas@python.org>
parents: 13447
diff changeset
25 /* Basic functions to manipulate cStringIO objects from C */
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
26
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
27 static struct PycStringIO_CAPI {
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
28
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
29 /* Read a string. If the last argument is -1, the remainder will be read. */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
30 int(*cread)(PyObject *, char **, int);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
32 /* Read a line */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
33 int(*creadline)(PyObject *, char **);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
34
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
35 /* Write a string */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
36 int(*cwrite)(PyObject *, char *, int);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
37
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
38 /* Get the cStringIO object as a Python string */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
39 PyObject *(*cgetvalue)(PyObject *);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
41 /* Create a new output object */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
42 PyObject *(*NewOutput)(int);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
43
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
44 /* Create an input object from a Python string */
13447
a89f7f268de4 Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents: 9944
diff changeset
45 PyObject *(*NewInput)(PyObject *);
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
46
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
47 /* The Python types for cStringIO input and output objects.
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
48 Note that you can do input on an output object.
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
49 */
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
50 PyTypeObject *InputType, *OutputType;
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
51
24580
ca20be24381f Remove function definition from cStringIO.h.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 22805
diff changeset
52 } *PycStringIO;
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
53
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 /* These can be used to test if you have one */
4902
d46e478b5767 Jim's latest version
Guido van Rossum <guido@python.org>
parents: 4598
diff changeset
55 #define PycStringIO_InputCheck(O) \
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
56 ((O)->ob_type==PycStringIO->InputType)
4902
d46e478b5767 Jim's latest version
Guido van Rossum <guido@python.org>
parents: 4598
diff changeset
57 #define PycStringIO_OutputCheck(O) \
5279
16372a4c4c14 Changed the way the C API was exported. Jim Fulton.
Guido van Rossum <guido@python.org>
parents: 4902
diff changeset
58 ((O)->ob_type==PycStringIO->OutputType)
4598
8fdb0539cfb1 Jim F's brainchild
Guido van Rossum <guido@python.org>
parents:
diff changeset
59
22688
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
60 #ifdef __cplusplus
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
61 }
c0596f84a8fb Patch #536908: Add missing #include guards/extern "C".
Martin v. Löwis <martin@v.loewis.de>
parents: 18064
diff changeset
62 #endif
25554
36124157b317 SF # 607253, header file problems by Ralf W. Grosse-Kunstleve
Neal Norwitz <nnorwitz@gmail.com>
parents: 24580
diff changeset
63 #endif /* !Py_CSTRINGIO_H */