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