summaryrefslogtreecommitdiffstats
path: root/Include/cStringIO.h
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-08-05 18:20:01 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-08-05 18:20:01 (GMT)
commitf4d32df19d0f43b7e6b9479a2aac7c80d8c7cf28 (patch)
treeeb762e18efefd276df0b11bb572ec354dafe3a1c /Include/cStringIO.h
parent5f8a23f32fb32476d97c0be4c7da2dea5efe3393 (diff)
downloadcpython-f4d32df19d0f43b7e6b9479a2aac7c80d8c7cf28.zip
cpython-f4d32df19d0f43b7e6b9479a2aac7c80d8c7cf28.tar.gz
cpython-f4d32df19d0f43b7e6b9479a2aac7c80d8c7cf28.tar.bz2
Remove function definition from cStringIO.h.
xxxPyCObject_Import() seems to be a copy of PyCObject_Import().
Diffstat (limited to 'Include/cStringIO.h')
-rw-r--r--Include/cStringIO.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/Include/cStringIO.h b/Include/cStringIO.h
index 235f777..224f8ff 100644
--- a/Include/cStringIO.h
+++ b/Include/cStringIO.h
@@ -18,6 +18,9 @@ extern "C" {
This would typically be done in your init function.
*/
+#define PycString_IMPORT \
+ PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", \
+ "cStringIO_CAPI")
/* Basic functions to manipulate cStringIO objects from C */
@@ -46,7 +49,7 @@ static struct PycStringIO_CAPI {
*/
PyTypeObject *InputType, *OutputType;
-} * PycStringIO = NULL;
+} *PycStringIO;
/* These can be used to test if you have one */
#define PycStringIO_InputCheck(O) \
@@ -54,28 +57,6 @@ static struct PycStringIO_CAPI {
#define PycStringIO_OutputCheck(O) \
((O)->ob_type==PycStringIO->OutputType)
-static void *
-xxxPyCObject_Import(char *module_name, char *name)
-{
- PyObject *m, *c;
- void *r=NULL;
-
- if((m=PyImport_ImportModule(module_name)))
- {
- if((c=PyObject_GetAttrString(m,name)))
- {
- r=PyCObject_AsVoidPtr(c);
- Py_DECREF(c);
- }
- Py_DECREF(m);
- }
-
- return r;
-}
-
-#define PycString_IMPORT \
- PycStringIO=(struct PycStringIO_CAPI*)xxxPyCObject_Import("cStringIO", "cStringIO_CAPI")
-
#ifdef __cplusplus
}
#endif