Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:50

0001 
0002 /* Capsule objects let you wrap a C "void *" pointer in a Python
0003    object.  They're a way of passing data through the Python interpreter
0004    without creating your own custom type.
0005 
0006    Capsules are used for communication between extension modules.
0007    They provide a way for an extension module to export a C interface
0008    to other extension modules, so that extension modules can use the
0009    Python import mechanism to link to one another.
0010 
0011    For more information, please see "c-api/capsule.html" in the
0012    documentation.
0013 */
0014 
0015 #ifndef Py_CAPSULE_H
0016 #define Py_CAPSULE_H
0017 #ifdef __cplusplus
0018 extern "C" {
0019 #endif
0020 
0021 PyAPI_DATA(PyTypeObject) PyCapsule_Type;
0022 
0023 typedef void (*PyCapsule_Destructor)(PyObject *);
0024 
0025 #define PyCapsule_CheckExact(op) Py_IS_TYPE((op), &PyCapsule_Type)
0026 
0027 
0028 PyAPI_FUNC(PyObject *) PyCapsule_New(
0029     void *pointer,
0030     const char *name,
0031     PyCapsule_Destructor destructor);
0032 
0033 PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name);
0034 
0035 PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule);
0036 
0037 PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule);
0038 
0039 PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule);
0040 
0041 PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name);
0042 
0043 PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer);
0044 
0045 PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);
0046 
0047 PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
0048 
0049 PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
0050 
0051 PyAPI_FUNC(void *) PyCapsule_Import(
0052     const char *name,           /* UTF-8 encoded string */
0053     int no_block);
0054 
0055 
0056 #ifdef __cplusplus
0057 }
0058 #endif
0059 #endif /* !Py_CAPSULE_H */