64
int
PyCapsule_IsValid
(
PyObject *capsule, const char *name
)
Determines whether or not capsule is a valid capsule. A valid capsule is non-NULL,
passes
PyCapsule_CheckExact()
, has a non-NULL pointer stored in it, and its internal
name matches the name parameter. (See
PyCapsule_GetPointer()
for information on
how capsule names are compared.)
In other words, if
PyCapsule_IsValid()
returns a true value, calls to any of the
accessors (any function starting with
PyCapsule_Get()
) are guaranteed to succeed.
Return a nonzero value if the object is valid and matches the name passed in. Return
0 otherwise. This function will not fail.
int
PyCapsule_SetContext
(
PyObject *capsule, void *context
)
Set the context pointer inside capsule to context.
Return 0 on success. Return nonzero and set an exception on failure.
int
PyCapsule_SetDestructor
(
PyObject *capsule, PyCapsule_Destructor destructor
)
Set the destructor inside capsule to destructor.
Return 0 on success. Return nonzero and set an exception on failure.
int
PyCapsule_SetName
(
PyObject *capsule, const char *name
)
Set the name inside capsule to name. If non-NULL, the name must outlive the
capsule. If the previous name stored in the capsule was not NULL, no attempt is
made to free it.
Return 0 on success. Return nonzero and set an exception on failure.
int
PyCapsule_SetPointer
(
PyObject *capsule, void *pointer
)
Set the void pointer inside capsule to pointer. The pointer may not be NULL.
Return 0 on success. Return nonzero and set an exception on failure.
index
modules |
next |
previous |
Python » Python v2.7.6 documentation » Python/C API Reference Manual » Concrete
Objects Layer »
© Copyright
1990-2013, Python Software Foundation.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 10, 2013. Found a bug
?
Created using Sphinx
1.0.7.