mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and
PyCObject_GetDesc().
This commit is contained in:
parent
16cb6f4612
commit
1f84449fd8
2 changed files with 66 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue