summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-10-21 19:48:35 (GMT)
committerGuido van Rossum <guido@python.org>1997-10-21 19:48:35 (GMT)
commit1f84449fd80ded6abf23d47147219e68dd65fc2f (patch)
tree0efa0b4b67a1344b65d1d656c6758ef18e00ab2b /Include
parent16cb6f4612235b6b4ae1d50be7857d4e0e5852f8 (diff)
downloadcpython-1f84449fd80ded6abf23d47147219e68dd65fc2f.zip
cpython-1f84449fd80ded6abf23d47147219e68dd65fc2f.tar.gz
cpython-1f84449fd80ded6abf23d47147219e68dd65fc2f.tar.bz2
New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
PyCObject_GetDesc().
Diffstat (limited to 'Include')
-rw-r--r--Include/cobject.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/Include/cobject.h b/Include/cobject.h
index 672e029..5979074 100644
--- a/Include/cobject.h
+++ b/Include/cobject.h
@@ -54,14 +54,27 @@ extern DL_IMPORT(PyTypeObject) PyCObject_Type;
destroyed.
*/
-
extern PyObject *
PyCObject_FromVoidPtr Py_PROTO((void *cobj, void (*destruct)(void*)));
+
+/* Create a PyCObject from a pointer to a C object, a description object,
+ and an optional destrutor function. If the third argument is non-null,
+ then it will be called with the first and second arguments if and when
+ the PyCObject is destroyed.
+*/
+extern PyObject *
+PyCObject_FromVoidPtrAndDesc Py_PROTO((void *cobj, void *desc,
+ void (*destruct)(void*,void*)));
+
/* Retrieve a pointer to a C object from a PyCObject. */
extern void *
PyCObject_AsVoidPtr Py_PROTO((PyObject *));
+/* Retrieve a pointer to a description object from a PyCObject. */
+extern void *
+PyCObject_GetDesc Py_PROTO((PyObject *));
+
/* Import a pointer to a C object from a module using a PyCObject. */
extern void *
PyCObject_Import Py_PROTO((char *module_name, char *cobject_name));