Mercurial > cpython-lru_cache-weakref
diff Include/cStringIO.h @ 24580:ca20be24381f legacy-trunk
Remove function definition from cStringIO.h.
xxxPyCObject_Import() seems to be a copy of PyCObject_Import().
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Mon, 05 Aug 2002 18:20:01 +0000 |
| parents | f1af8ad11000 |
| children | 36124157b317 |
line wrap: on
line diff
--- a/Include/cStringIO.h Mon Aug 05 18:06:17 2002 +0000 +++ b/Include/cStringIO.h Mon Aug 05 18:20:01 2002 +0000 @@ -18,6 +18,9 @@ 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 @@ */ PyTypeObject *InputType, *OutputType; -} * PycStringIO = NULL; +} *PycStringIO; /* These can be used to test if you have one */ #define PycStringIO_InputCheck(O) \ @@ -54,28 +57,6 @@ #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
