]>
Commit | Line | Data |
---|---|---|
c8042e10 DM |
1 | \r |
2 | /* Capsule objects let you wrap a C "void *" pointer in a Python\r | |
3 | object. They're a way of passing data through the Python interpreter\r | |
4 | without creating your own custom type.\r | |
5 | \r | |
6 | Capsules are used for communication between extension modules.\r | |
7 | They provide a way for an extension module to export a C interface\r | |
8 | to other extension modules, so that extension modules can use the\r | |
9 | Python import mechanism to link to one another.\r | |
10 | \r | |
11 | For more information, please see "c-api/capsule.html" in the\r | |
12 | documentation.\r | |
13 | */\r | |
14 | \r | |
15 | #ifndef Py_CAPSULE_H\r | |
16 | #define Py_CAPSULE_H\r | |
17 | #ifdef __cplusplus\r | |
18 | extern "C" {\r | |
19 | #endif\r | |
20 | \r | |
21 | PyAPI_DATA(PyTypeObject) PyCapsule_Type;\r | |
22 | \r | |
23 | typedef void (*PyCapsule_Destructor)(PyObject *);\r | |
24 | \r | |
25 | #define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type)\r | |
26 | \r | |
27 | \r | |
28 | PyAPI_FUNC(PyObject *) PyCapsule_New(\r | |
29 | void *pointer,\r | |
30 | const char *name,\r | |
31 | PyCapsule_Destructor destructor);\r | |
32 | \r | |
33 | PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name);\r | |
34 | \r | |
35 | PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule);\r | |
36 | \r | |
37 | PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule);\r | |
38 | \r | |
39 | PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule);\r | |
40 | \r | |
41 | PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name);\r | |
42 | \r | |
43 | PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer);\r | |
44 | \r | |
45 | PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);\r | |
46 | \r | |
47 | PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);\r | |
48 | \r | |
49 | PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);\r | |
50 | \r | |
51 | PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block);\r | |
52 | \r | |
53 | #ifdef __cplusplus\r | |
54 | }\r | |
55 | #endif\r | |
56 | #endif /* !Py_CAPSULE_H */\r |