cobject.pxd 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. cdef extern from "Python.h":
  2. ###########################################################################
  3. # Warning:
  4. #
  5. # The CObject API is deprecated as of Python 3.1. Please switch to
  6. # the new Capsules API.
  7. ###########################################################################
  8. int PyCObject_Check(object p)
  9. # Return true if its argument is a PyCObject.
  10. object PyCObject_FromVoidPtr(void* cobj, void (*destr)(void *))
  11. # Return value: New reference.
  12. #
  13. # Create a PyCObject from the void * cobj. The destr function will
  14. # be called when the object is reclaimed, unless it is NULL.
  15. object PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, void (*destr)(void *, void *))
  16. # Return value: New reference.
  17. #
  18. # Create a PyCObject from the void * cobj. The destr function will
  19. # be called when the object is reclaimed. The desc argument can be
  20. # used to pass extra callback data for the destructor function.
  21. void* PyCObject_AsVoidPtr(object self) except? NULL
  22. # Return the object void * that the PyCObject self was created with.
  23. void* PyCObject_GetDesc(object self) except? NULL
  24. # Return the description void * that the PyCObject self was created with.
  25. int PyCObject_SetVoidPtr(object self, void* cobj) except 0
  26. # Set the void pointer inside self to cobj. The PyCObject must not
  27. # have an associated destructor. Return true on success, false on
  28. # failure.