File: Capsule.c

package info (click to toggle)
cython 0.29.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,712 kB
  • sloc: python: 67,282; ansic: 14,240; cpp: 1,316; xml: 1,031; makefile: 372; lisp: 206; sh: 22; sed: 11
file content (20 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//////////////// Capsule.proto ////////////////

/* Todo: wrap the rest of the functionality in similar functions */
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);

//////////////// Capsule ////////////////

static CYTHON_INLINE PyObject *
__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
{
    PyObject *cobj;

#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(p, sig, NULL);
#else
    cobj = PyCObject_FromVoidPtr(p, NULL);
#endif

    return cobj;
}