Home
last modified time | relevance | path

Searched refs:capsule (Results 1 – 17 of 17) sorted by relevance

/third_party/python/Objects/
Dcapsule.c17 _is_legal_capsule(PyCapsule *capsule, const char *invalid_capsule) in _is_legal_capsule() argument
19 if (!capsule || !PyCapsule_CheckExact(capsule) || capsule->pointer == NULL) { in _is_legal_capsule()
26 #define is_legal_capsule(capsule, name) \ argument
27 (_is_legal_capsule(capsule, \
46 PyCapsule *capsule; in PyCapsule_New() local
53 capsule = PyObject_New(PyCapsule, &PyCapsule_Type); in PyCapsule_New()
54 if (capsule == NULL) { in PyCapsule_New()
58 capsule->pointer = pointer; in PyCapsule_New()
59 capsule->name = name; in PyCapsule_New()
60 capsule->context = NULL; in PyCapsule_New()
[all …]
/third_party/python/Doc/c-api/
Dcapsule.rst27 The type of a destructor callback for a capsule. Defined as::
49 non-``NULL``, this string must outlive the capsule. (Though it is permitted to
53 capsule as its argument when it is destroyed.
55 If this capsule will be stored as an attribute of a module, the *name* should
57 to import the capsule using :c:func:`PyCapsule_Import`.
60 .. c:function:: void* PyCapsule_GetPointer(PyObject *capsule, const char *name)
62 Retrieve the *pointer* stored in the capsule. On failure, set an exception
65 The *name* parameter must compare exactly to the name stored in the capsule.
66 If the name stored in the capsule is ``NULL``, the *name* passed in must also
67 be ``NULL``. Python uses the C function :c:func:`strcmp` to compare capsule
[all …]
Dconcrete.rst113 capsule.rst
/third_party/python/Include/
Dpycapsule.h33 PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name);
35 PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule);
37 PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule);
39 PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule);
41 PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name);
43 PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer);
45 PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);
47 PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
49 PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
/third_party/python/Modules/cjkcodecs/
Dcjkcodecs.h309 PyObject *capsule = PyCapsule_New((void *)h, in register_maps() local
311 if (capsule == NULL) { in register_maps()
314 if (PyModule_AddObject(module, mhname, capsule) < 0) { in register_maps()
315 Py_DECREF(capsule); in register_maps()
/third_party/python/Modules/
Dunicodedata.c1313 unicodedata_destroy_capi(PyObject *capsule) in unicodedata_destroy_capi() argument
1315 void *capi = PyCapsule_GetPointer(capsule, PyUnicodeData_CAPSULE_NAME); in unicodedata_destroy_capi()
1330 PyObject *capsule = PyCapsule_New(capi, in unicodedata_create_capi() local
1333 if (capsule == NULL) { in unicodedata_create_capi()
1336 return capsule; in unicodedata_create_capi()
1512 PyObject *capsule = unicodedata_create_capi(); in unicodedata_exec() local
1513 if (capsule == NULL) { in unicodedata_exec()
1516 int rc = PyModule_AddObjectRef(module, "_ucnhash_CAPI", capsule); in unicodedata_exec()
1517 Py_DECREF(capsule); in unicodedata_exec()
Dsocketmodule.c7043 sock_destroy_api(PyObject *capsule) argument
7045 void *capi = PyCapsule_GetPointer(capsule, PySocket_CAPSULE_NAME);
7150 PyObject *capsule = PyCapsule_New(capi, local
7153 if (capsule == NULL) {
7158 if (PyModule_AddObject(m, PySocket_CAPI_NAME, capsule) < 0) {
7159 Py_DECREF(capsule);
/third_party/python/Python/
Dcompile.c685 PyObject *capsule = PyCapsule_New(c->u, CAPSULE_NAME, NULL); in compiler_enter_scope() local
686 if (!capsule || PyList_Append(c->c_stack, capsule) < 0) { in compiler_enter_scope()
687 Py_XDECREF(capsule); in compiler_enter_scope()
691 Py_DECREF(capsule); in compiler_enter_scope()
724 PyObject *capsule = PyList_GET_ITEM(c->c_stack, n); in compiler_exit_scope() local
725 c->u = (struct compiler_unit *)PyCapsule_GetPointer(capsule, CAPSULE_NAME); in compiler_exit_scope()
756 PyObject *mangled, *capsule; in compiler_set_qualname() local
758 capsule = PyList_GET_ITEM(c->c_stack, stack_size - 1); in compiler_set_qualname()
759 parent = (struct compiler_unit *)PyCapsule_GetPointer(capsule, CAPSULE_NAME); in compiler_set_qualname()
/third_party/python/Doc/whatsnew/
D2.7.rst2280 C API to an extension module. A capsule is essentially the holder of
2284 can import the module, access its dictionary to get the capsule
2299 if (!PyCapsule_IsValid(capsule, "mymodule.CAPI") {
2304 vtable = PyCapsule_GetPointer(capsule, "mymodule.CAPI");
2307 If a different capsule was passed in, :c:func:`PyCapsule_IsValid` would
D3.0.rst555 reference for the major changes to the library. Here's a capsule
/third_party/python/Tools/c-analyzer/cpython/
Dignored.tsv1616 Objects/capsule.c - PyCapsule_Type -
2728 Modules/_decimal/_decimal.c PyInit__decimal capsule -
/third_party/python/Doc/data/
Drefcounts.dat177 PyCapsule_IsValid:PyObject*:capsule:0:
/third_party/python/Tools/c-analyzer/
DTODO683 Objects/capsule.c:PyCapsule_Type PyTypeObject PyCapsule_Type
/third_party/python/
DMakefile.pre.in409 Objects/capsule.o \
/third_party/python/Misc/NEWS.d/
D3.10.0a1.rst3288 Add a minimal decimal capsule API. The API supports fast conversions
/third_party/mindspore/tests/ut/data/mindrecord/testAclImdbData/
Dvocab.txt18270 capsule
/third_party/python/Misc/
DHISTORY12858 - Issue #5939: Add additional runtime checking to ensure a valid capsule in