Changeset 391 for python/trunk/Doc/c-api/cobject.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/c-api/cobject.rst
r2 r391 8 8 .. index:: object: CObject 9 9 10 Refer to :ref:`using-cobjects` for more information on using these objects.11 10 11 .. warning:: 12 12 13 .. ctype:: PyCObject 13 The CObject API is deprecated as of Python 2.7. Please switch to the new 14 :ref:`capsules` API. 14 15 15 This subtype of :ctype:`PyObject` represents an opaque value, useful for C 16 extension modules who need to pass an opaque value (as a :ctype:`void\*` 16 .. c:type:: PyCObject 17 18 This subtype of :c:type:`PyObject` represents an opaque value, useful for C 19 extension modules who need to pass an opaque value (as a :c:type:`void\*` 17 20 pointer) through Python code to other C code. It is often used to make a C 18 21 function pointer defined in one module available to other modules, so the … … 21 24 22 25 23 .. c function:: int PyCObject_Check(PyObject *p)26 .. c:function:: int PyCObject_Check(PyObject *p) 24 27 25 Return true if its argument is a :c type:`PyCObject`.28 Return true if its argument is a :c:type:`PyCObject`. 26 29 27 30 28 .. c function:: PyObject* PyCObject_FromVoidPtr(void* cobj, void (*destr)(void *))31 .. c:function:: PyObject* PyCObject_FromVoidPtr(void* cobj, void (*destr)(void *)) 29 32 30 Create a :c type:`PyCObject` from the ``void *`` *cobj*. The *destr* function33 Create a :c:type:`PyCObject` from the ``void *`` *cobj*. The *destr* function 31 34 will be called when the object is reclaimed, unless it is *NULL*. 32 35 33 36 34 .. c function:: PyObject* PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, void (*destr)(void *, void *))37 .. c:function:: PyObject* PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, void (*destr)(void *, void *)) 35 38 36 Create a :c type:`PyCObject` from the :ctype:`void \*` *cobj*. The *destr*39 Create a :c:type:`PyCObject` from the :c:type:`void \*` *cobj*. The *destr* 37 40 function will be called when the object is reclaimed. The *desc* argument can 38 41 be used to pass extra callback data for the destructor function. 39 42 40 43 41 .. c function:: void* PyCObject_AsVoidPtr(PyObject* self)44 .. c:function:: void* PyCObject_AsVoidPtr(PyObject* self) 42 45 43 Return the object :c type:`void \*` that the :ctype:`PyCObject` *self* was46 Return the object :c:type:`void \*` that the :c:type:`PyCObject` *self* was 44 47 created with. 45 48 46 49 47 .. c function:: void* PyCObject_GetDesc(PyObject* self)50 .. c:function:: void* PyCObject_GetDesc(PyObject* self) 48 51 49 Return the description :c type:`void \*` that the :ctype:`PyCObject` *self* was52 Return the description :c:type:`void \*` that the :c:type:`PyCObject` *self* was 50 53 created with. 51 54 52 55 53 .. c function:: int PyCObject_SetVoidPtr(PyObject* self, void* cobj)56 .. c:function:: int PyCObject_SetVoidPtr(PyObject* self, void* cobj) 54 57 55 Set the void pointer inside *self* to *cobj*. The :c type:`PyCObject` must not58 Set the void pointer inside *self* to *cobj*. The :c:type:`PyCObject` must not 56 59 have an associated destructor. Return true on success, false on failure.
Note:
See TracChangeset
for help on using the changeset viewer.