Capsule.c 505 B

1234567891011121314151617181920
  1. //////////////// Capsule.proto ////////////////
  2. /* Todo: wrap the rest of the functionality in similar functions */
  3. static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
  4. //////////////// Capsule ////////////////
  5. static CYTHON_INLINE PyObject *
  6. __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
  7. {
  8. PyObject *cobj;
  9. #if PY_VERSION_HEX >= 0x02070000
  10. cobj = PyCapsule_New(p, sig, NULL);
  11. #else
  12. cobj = PyCObject_FromVoidPtr(p, NULL);
  13. #endif
  14. return cobj;
  15. }