| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
#ifndef Py_CAPSULE_H |
| 16 |
#define Py_CAPSULE_H |
| 17 |
#ifdef __cplusplus |
| 18 |
extern "C" { |
| 19 |
#endif |
| 20 |
|
| 21 |
PyAPI_DATA(PyTypeObject) PyCapsule_Type; |
| 22 |
|
| 23 |
typedef void (*PyCapsule_Destructor)(PyObject *); |
| 24 |
|
| 25 |
#define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) |
| 26 |
|
| 27 |
|
| 28 |
PyAPI_FUNC(PyObject *) PyCapsule_New( |
| 29 |
void *pointer, |
| 30 |
const char *name, |
| 31 |
PyCapsule_Destructor destructor); |
| 32 |
|
| 33 |
PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); |
| 34 |
|
| 35 |
PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); |
| 36 |
|
| 37 |
PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); |
| 38 |
|
| 39 |
PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); |
| 40 |
|
| 41 |
PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); |
| 42 |
|
| 43 |
PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); |
| 44 |
|
| 45 |
PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); |
| 46 |
|
| 47 |
PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); |
| 48 |
|
| 49 |
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); |
| 50 |
|
| 51 |
PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block); |
| 52 |
|
| 53 |
#ifdef __cplusplus |
| 54 |
} |
| 55 |
#endif |
| 56 |
#endif |