File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,28 @@ defined closer to where they are useful (e.g. :c:macro:`Py_RETURN_NONE`).
105
105
Others of a more general utility are defined here. This is not necessarily a
106
106
complete listing.
107
107
108
+ .. c :macro :: PyAPI_DATA(type)
109
+
110
+ Declare a variable of type *type * which should be exported by Python. The
111
+ macro should only be used in Python C API. Example::
112
+
113
+ PyAPI_DATA(const unsigned long) Py_Version;
114
+
115
+ .. c :macro :: PyAPI_FUNC(type)
116
+
117
+ Declare a function with a return type *type * which should be exported by
118
+ Python. The macro should only be used in Python C API. Example::
119
+
120
+ PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
121
+
122
+ .. c :macro :: PyMODINIT_FUNC
123
+
124
+ Declare an extension module ``PyInit `` initialization function. The return
125
+ type is :c:expr: `PyObject* `. The macro should only be used in Python C API.
126
+ Example with the ``_ssl `` module::
127
+
128
+ PyMODINIT_FUNC PyInit__ssl(void)
129
+
108
130
.. c :macro :: Py_ABS(x)
109
131
110
132
Return the absolute value of ``x ``.
You can’t perform that action at this time.
0 commit comments