- Got rid of newmodule.c
[python/dscho.git] / Include / Python.h
blobff21ad1b85e0282da7558042915d266f4447f05d
1 #ifndef Py_PYTHON_H
2 #define Py_PYTHON_H
3 /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
6 /* Enable compiler features; switching on C lib defines doesn't work
7 here, because the symbols haven't necessarily been defined yet. */
8 #ifndef _GNU_SOURCE
9 # define _GNU_SOURCE 1
10 #endif
12 /* Forcing SUSv2 compatibility still produces problems on some
13 platforms, True64 and SGI IRIX being two of them, so for now the
14 define is switched off. */
15 #if 0
16 #ifndef _XOPEN_SOURCE
17 # define _XOPEN_SOURCE 500
18 #endif
19 #endif
21 /* Include nearly all Python header files */
23 #include "patchlevel.h"
24 #include "pyconfig.h"
26 #ifdef HAVE_LIMITS_H
27 #include <limits.h>
28 #endif
30 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
31 #define _SGI_MP_SOURCE
32 #endif
34 #include <stdio.h>
35 #ifndef NULL
36 # error "Python.h requires that stdio.h define NULL."
37 #endif
39 #include <string.h>
40 #include <errno.h>
41 #ifdef HAVE_STDLIB_H
42 #include <stdlib.h>
43 #endif
44 #ifdef HAVE_UNISTD_H
45 #include <unistd.h>
46 #endif
48 /* CAUTION: Build setups should ensure that NDEBUG is defined on the
49 * compiler command line when building Python in release mode; else
50 * assert() calls won't be removed.
52 #include <assert.h>
54 #include "pyport.h"
56 /* pyconfig.h or pyport.h may or may not define DL_IMPORT */
57 #ifndef DL_IMPORT /* declarations for DLL import/export */
58 #define DL_IMPORT(RTYPE) RTYPE
59 #endif
60 #ifndef DL_EXPORT /* declarations for DLL import/export */
61 #define DL_EXPORT(RTYPE) RTYPE
62 #endif
64 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
65 * PYMALLOC_DEBUG is in error if pymalloc is not in use.
67 #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
68 #define PYMALLOC_DEBUG
69 #endif
70 #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
71 #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
72 #endif
73 #include "pymem.h"
75 #include "object.h"
76 #include "objimpl.h"
78 #include "pydebug.h"
80 #include "unicodeobject.h"
81 #include "intobject.h"
82 #include "boolobject.h"
83 #include "longobject.h"
84 #include "floatobject.h"
85 #ifndef WITHOUT_COMPLEX
86 #include "complexobject.h"
87 #endif
88 #include "rangeobject.h"
89 #include "stringobject.h"
90 #include "bufferobject.h"
91 #include "tupleobject.h"
92 #include "listobject.h"
93 #include "dictobject.h"
94 #include "enumobject.h"
95 #include "methodobject.h"
96 #include "moduleobject.h"
97 #include "funcobject.h"
98 #include "classobject.h"
99 #include "fileobject.h"
100 #include "cobject.h"
101 #include "traceback.h"
102 #include "sliceobject.h"
103 #include "cellobject.h"
104 #include "iterobject.h"
105 #include "descrobject.h"
106 #include "weakrefobject.h"
108 #include "codecs.h"
109 #include "pyerrors.h"
111 #include "pystate.h"
113 #include "modsupport.h"
114 #include "pythonrun.h"
115 #include "ceval.h"
116 #include "sysmodule.h"
117 #include "intrcheck.h"
118 #include "import.h"
120 #include "abstract.h"
122 /* _Py_Mangle is defined in compile.c */
123 extern DL_IMPORT(int) _Py_Mangle(char *p, char *name, \
124 char *buffer, size_t maxlen);
126 /* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */
127 #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
129 /* PyArg_NoArgs should not be necessary.
130 Set ml_flags in the PyMethodDef to METH_NOARGS. */
131 #define PyArg_NoArgs(v) PyArg_Parse(v, "")
133 /* Convert a possibly signed character to a nonnegative int */
134 /* XXX This assumes characters are 8 bits wide */
135 #ifdef __CHAR_UNSIGNED__
136 #define Py_CHARMASK(c) (c)
137 #else
138 #define Py_CHARMASK(c) ((c) & 0xff)
139 #endif
141 #include "pyfpe.h"
143 /* These definitions must match corresponding definitions in graminit.h.
144 There's code in compile.c that checks that they are the same. */
145 #define Py_single_input 256
146 #define Py_file_input 257
147 #define Py_eval_input 258
149 #ifdef HAVE_PTH
150 /* GNU pth user-space thread support */
151 #include <pth.h>
152 #endif
154 /* Define macros for inline documentation. */
155 #define PyDoc_VAR(name) static char name[]
156 #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
157 #ifdef WITH_DOC_STRINGS
158 #define PyDoc_STR(str) str
159 #else
160 #define PyDoc_STR(str) ""
161 #endif
163 #endif /* !Py_PYTHON_H */