@@ -16,15 +16,15 @@ Refer to :ref:`using-capsules` for more information on using these objects.
1616
1717 This subtype of :c:type: `PyObject ` represents an opaque value, useful for C
1818 extension modules who need to pass an opaque value (as a :c:expr: `void* `
19- pointer) through Python code to other C code. It is often used to make a C
19+ pointer) through Python code to other C code. It is often used to make a C
2020 function pointer defined in one module available to other modules, so the
2121 regular import mechanism can be used to access C APIs defined in dynamically
2222 loaded modules.
2323
2424
2525.. c :type :: PyCapsule_Destructor
2626
27- The type of a destructor callback for a capsule. Defined as::
27+ The type of a destructor callback for a capsule. Defined as::
2828
2929 typedef void (*PyCapsule_Destructor)(PyObject *);
3030
@@ -34,81 +34,81 @@ Refer to :ref:`using-capsules` for more information on using these objects.
3434
3535.. c :function :: int PyCapsule_CheckExact (PyObject *p)
3636
37- Return true if its argument is a :c:type: `PyCapsule `. This function always
37+ Return true if its argument is a :c:type: `PyCapsule `. This function always
3838 succeeds.
3939
4040
4141.. c :function :: PyObject* PyCapsule_New (void *pointer, const char *name, PyCapsule_Destructor destructor)
4242
43- Create a :c:type: `PyCapsule ` encapsulating the *pointer *. The *pointer *
43+ Create a :c:type: `PyCapsule ` encapsulating the *pointer *. The *pointer *
4444 argument may not be ``NULL ``.
4545
4646 On failure, set an exception and return ``NULL ``.
4747
48- The *name * string may either be ``NULL `` or a pointer to a valid C string. If
49- non-``NULL ``, this string must outlive the capsule. (Though it is permitted to
48+ The *name * string may either be ``NULL `` or a pointer to a valid C string. If
49+ non-``NULL ``, this string must outlive the capsule. (Though it is permitted to
5050 free it inside the *destructor *.)
5151
5252 If the *destructor* argument is not ``NULL``, it will be called with the
5353 capsule as its argument when it is destroyed.
5454
5555 If this capsule will be stored as an attribute of a module, the *name* should
56- be specified as ``modulename.attributename``. This will enable other modules
56+ be specified as ``modulename.attributename``. This will enable other modules
5757 to import the capsule using :c:func:`PyCapsule_Import`.
5858
5959
6060.. c:function:: void* PyCapsule_GetPointer(PyObject *capsule, const char *name)
6161
62- Retrieve the *pointer * stored in the capsule. On failure, set an exception
62+ Retrieve the *pointer * stored in the capsule. On failure, set an exception
6363 and return ``NULL ``.
6464
6565 The *name * parameter must compare exactly to the name stored in the capsule.
6666 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
67+ be ``NULL ``. Python uses the C function :c:func: `!strcmp ` to compare capsule
6868 names.
6969
7070
7171.. c :function :: PyCapsule_Destructor PyCapsule_GetDestructor (PyObject *capsule)
7272
73- Return the current destructor stored in the capsule. On failure, set an
73+ Return the current destructor stored in the capsule. On failure, set an
7474 exception and return ``NULL ``.
7575
76- It is legal for a capsule to have a ``NULL `` destructor. This makes a ``NULL ``
76+ It is legal for a capsule to have a ``NULL `` destructor. This makes a ``NULL ``
7777 return code somewhat ambiguous; use :c:func: `PyCapsule_IsValid ` or
7878 :c:func: `PyErr_Occurred ` to disambiguate.
7979
8080
8181.. c :function :: void * PyCapsule_GetContext (PyObject *capsule)
8282
83- Return the current context stored in the capsule. On failure, set an
83+ Return the current context stored in the capsule. On failure, set an
8484 exception and return ``NULL ``.
8585
86- It is legal for a capsule to have a ``NULL `` context. This makes a ``NULL ``
86+ It is legal for a capsule to have a ``NULL `` context. This makes a ``NULL ``
8787 return code somewhat ambiguous; use :c:func: `PyCapsule_IsValid ` or
8888 :c:func: `PyErr_Occurred ` to disambiguate.
8989
9090
9191.. c :function :: const char * PyCapsule_GetName (PyObject *capsule)
9292
93- Return the current name stored in the capsule. On failure, set an exception
93+ Return the current name stored in the capsule. On failure, set an exception
9494 and return ``NULL ``.
9595
96- It is legal for a capsule to have a ``NULL `` name. This makes a ``NULL `` return
96+ It is legal for a capsule to have a ``NULL `` name. This makes a ``NULL `` return
9797 code somewhat ambiguous; use :c:func: `PyCapsule_IsValid ` or
9898 :c:func: `PyErr_Occurred ` to disambiguate.
9999
100100
101101.. c :function :: void * PyCapsule_Import (const char *name, int no_block)
102102
103- Import a pointer to a C object from a capsule attribute in a module. The
103+ Import a pointer to a C object from a capsule attribute in a module. The
104104 *name * parameter should specify the full name to the attribute, as in
105- ``module.attribute ``. The *name * stored in the capsule must match this
105+ ``module.attribute ``. The *name * stored in the capsule must match this
106106 string exactly.
107107
108108 This function splits *name * on the ``. `` character, and imports the first
109109 element. It then processes further elements using attribute lookups.
110110
111- Return the capsule's internal *pointer * on success. On failure, set an
111+ Return the capsule's internal *pointer * on success. On failure, set an
112112 exception and return ``NULL ``.
113113
114114 .. note ::
@@ -124,9 +124,9 @@ Refer to :ref:`using-capsules` for more information on using these objects.
124124
125125.. c:function:: int PyCapsule_IsValid(PyObject *capsule, const char *name)
126126
127- Determines whether or not *capsule * is a valid capsule. A valid capsule is
127+ Determines whether or not *capsule * is a valid capsule. A valid capsule is
128128 non-``NULL ``, passes :c:func: `PyCapsule_CheckExact `, has a non-``NULL `` pointer
129- stored in it, and its internal name matches the *name * parameter. (See
129+ stored in it, and its internal name matches the *name * parameter. (See
130130 :c:func: `PyCapsule_GetPointer ` for information on how capsule names are
131131 compared.)
132132
@@ -135,35 +135,35 @@ Refer to :ref:`using-capsules` for more information on using these objects.
135135 guaranteed to succeed.
136136
137137 Return a nonzero value if the object is valid and matches the name passed in.
138- Return ``0`` otherwise. This function will not fail.
138+ Return ``0`` otherwise. This function will not fail.
139139
140140
141141.. c:function:: int PyCapsule_SetContext(PyObject *capsule, void *context)
142142
143143 Set the context pointer inside *capsule * to *context *.
144144
145- Return ``0 `` on success. Return nonzero and set an exception on failure.
145+ Return ``0 `` on success. Return nonzero and set an exception on failure.
146146
147147
148148.. c :function :: int PyCapsule_SetDestructor (PyObject *capsule, PyCapsule_Destructor destructor)
149149
150150 Set the destructor inside *capsule * to *destructor *.
151151
152- Return ``0 `` on success. Return nonzero and set an exception on failure.
152+ Return ``0 `` on success. Return nonzero and set an exception on failure.
153153
154154
155155.. c :function :: int PyCapsule_SetName (PyObject *capsule, const char *name)
156156
157- Set the name inside *capsule * to *name *. If non-``NULL ``, the name must
158- outlive the capsule. If the previous *name * stored in the capsule was not
157+ Set the name inside *capsule * to *name *. If non-``NULL ``, the name must
158+ outlive the capsule. If the previous *name * stored in the capsule was not
159159 ``NULL ``, no attempt is made to free it.
160160
161- Return ``0 `` on success. Return nonzero and set an exception on failure.
161+ Return ``0 `` on success. Return nonzero and set an exception on failure.
162162
163163
164164.. c :function :: int PyCapsule_SetPointer (PyObject *capsule, void *pointer)
165165
166- Set the void pointer inside *capsule * to *pointer *. The pointer may not be
166+ Set the void pointer inside *capsule * to *pointer *. The pointer may not be
167167 ``NULL ``.
168168
169- Return ``0 `` on success. Return nonzero and set an exception on failure.
169+ Return ``0 `` on success. Return nonzero and set an exception on failure.
0 commit comments