]>
Commit | Line | Data |
---|---|---|
c8042e10 DM |
1 | \r |
2 | #ifndef Py_MODSUPPORT_H\r | |
3 | #define Py_MODSUPPORT_H\r | |
4 | #ifdef __cplusplus\r | |
5 | extern "C" {\r | |
6 | #endif\r | |
7 | \r | |
8 | /* Module support interface */\r | |
9 | \r | |
10 | #include <stdarg.h>\r | |
11 | \r | |
12 | /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier\r | |
13 | to mean Py_ssize_t */\r | |
14 | #ifdef PY_SSIZE_T_CLEAN\r | |
15 | #define PyArg_Parse _PyArg_Parse_SizeT\r | |
16 | #define PyArg_ParseTuple _PyArg_ParseTuple_SizeT\r | |
17 | #define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT\r | |
18 | #define PyArg_VaParse _PyArg_VaParse_SizeT\r | |
19 | #define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT\r | |
20 | #define Py_BuildValue _Py_BuildValue_SizeT\r | |
21 | #define Py_VaBuildValue _Py_VaBuildValue_SizeT\r | |
22 | #else\r | |
23 | PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);\r | |
24 | #endif\r | |
25 | \r | |
26 | PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);\r | |
27 | PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);\r | |
28 | PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,\r | |
29 | const char *, char **, ...);\r | |
30 | PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);\r | |
31 | PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);\r | |
32 | PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);\r | |
33 | PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);\r | |
34 | \r | |
35 | PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list);\r | |
36 | PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,\r | |
37 | const char *, char **, va_list);\r | |
38 | PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);\r | |
39 | \r | |
40 | PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);\r | |
41 | PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);\r | |
42 | PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);\r | |
43 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)\r | |
44 | #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)\r | |
45 | \r | |
46 | #define PYTHON_API_VERSION 1013\r | |
47 | #define PYTHON_API_STRING "1013"\r | |
48 | /* The API version is maintained (independently from the Python version)\r | |
49 | so we can detect mismatches between the interpreter and dynamically\r | |
50 | loaded modules. These are diagnosed by an error message but\r | |
51 | the module is still loaded (because the mismatch can only be tested\r | |
52 | after loading the module). The error message is intended to\r | |
53 | explain the core dump a few seconds later.\r | |
54 | \r | |
55 | The symbol PYTHON_API_STRING defines the same value as a string\r | |
56 | literal. *** PLEASE MAKE SURE THE DEFINITIONS MATCH. ***\r | |
57 | \r | |
58 | Please add a line or two to the top of this log for each API\r | |
59 | version change:\r | |
60 | \r | |
61 | 22-Feb-2006 MvL 1013 PEP 353 - long indices for sequence lengths\r | |
62 | \r | |
63 | 19-Aug-2002 GvR 1012 Changes to string object struct for\r | |
64 | interning changes, saving 3 bytes.\r | |
65 | \r | |
66 | 17-Jul-2001 GvR 1011 Descr-branch, just to be on the safe side\r | |
67 | \r | |
68 | 25-Jan-2001 FLD 1010 Parameters added to PyCode_New() and\r | |
69 | PyFrame_New(); Python 2.1a2\r | |
70 | \r | |
71 | 14-Mar-2000 GvR 1009 Unicode API added\r | |
72 | \r | |
73 | 3-Jan-1999 GvR 1007 Decided to change back! (Don't reuse 1008!)\r | |
74 | \r | |
75 | 3-Dec-1998 GvR 1008 Python 1.5.2b1\r | |
76 | \r | |
77 | 18-Jan-1997 GvR 1007 string interning and other speedups\r | |
78 | \r | |
79 | 11-Oct-1996 GvR renamed Py_Ellipses to Py_Ellipsis :-(\r | |
80 | \r | |
81 | 30-Jul-1996 GvR Slice and ellipses syntax added\r | |
82 | \r | |
83 | 23-Jul-1996 GvR For 1.4 -- better safe than sorry this time :-)\r | |
84 | \r | |
85 | 7-Nov-1995 GvR Keyword arguments (should've been done at 1.3 :-( )\r | |
86 | \r | |
87 | 10-Jan-1995 GvR Renamed globals to new naming scheme\r | |
88 | \r | |
89 | 9-Jan-1995 GvR Initial version (incompatible with older API)\r | |
90 | */\r | |
91 | \r | |
92 | #ifdef MS_WINDOWS\r | |
93 | /* Special defines for Windows versions used to live here. Things\r | |
94 | have changed, and the "Version" is now in a global string variable.\r | |
95 | Reason for this is that this for easier branding of a "custom DLL"\r | |
96 | without actually needing a recompile. */\r | |
97 | #endif /* MS_WINDOWS */\r | |
98 | \r | |
99 | #if SIZEOF_SIZE_T != SIZEOF_INT\r | |
100 | /* On a 64-bit system, rename the Py_InitModule4 so that 2.4\r | |
101 | modules cannot get loaded into a 2.5 interpreter */\r | |
102 | #define Py_InitModule4 Py_InitModule4_64\r | |
103 | #endif\r | |
104 | \r | |
105 | #ifdef Py_TRACE_REFS\r | |
106 | /* When we are tracing reference counts, rename Py_InitModule4 so\r | |
107 | modules compiled with incompatible settings will generate a\r | |
108 | link-time error. */\r | |
109 | #if SIZEOF_SIZE_T != SIZEOF_INT\r | |
110 | #undef Py_InitModule4\r | |
111 | #define Py_InitModule4 Py_InitModule4TraceRefs_64\r | |
112 | #else\r | |
113 | #define Py_InitModule4 Py_InitModule4TraceRefs\r | |
114 | #endif\r | |
115 | #endif\r | |
116 | \r | |
117 | PyAPI_FUNC(PyObject *) Py_InitModule4(const char *name, PyMethodDef *methods,\r | |
118 | const char *doc, PyObject *self,\r | |
119 | int apiver);\r | |
120 | \r | |
121 | #define Py_InitModule(name, methods) \\r | |
122 | Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \\r | |
123 | PYTHON_API_VERSION)\r | |
124 | \r | |
125 | #define Py_InitModule3(name, methods, doc) \\r | |
126 | Py_InitModule4(name, methods, doc, (PyObject *)NULL, \\r | |
127 | PYTHON_API_VERSION)\r | |
128 | \r | |
129 | PyAPI_DATA(char *) _Py_PackageContext;\r | |
130 | \r | |
131 | #ifdef __cplusplus\r | |
132 | }\r | |
133 | #endif\r | |
134 | #endif /* !Py_MODSUPPORT_H */\r |