jpayne@69
|
1 #ifndef Py_PYTHON_H
|
jpayne@69
|
2 #define Py_PYTHON_H
|
jpayne@69
|
3 /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
|
jpayne@69
|
4
|
jpayne@69
|
5 /* Include nearly all Python header files */
|
jpayne@69
|
6
|
jpayne@69
|
7 #include "patchlevel.h"
|
jpayne@69
|
8 #include "pyconfig.h"
|
jpayne@69
|
9 #include "pymacconfig.h"
|
jpayne@69
|
10
|
jpayne@69
|
11 #include <limits.h>
|
jpayne@69
|
12
|
jpayne@69
|
13 #ifndef UCHAR_MAX
|
jpayne@69
|
14 #error "Something's broken. UCHAR_MAX should be defined in limits.h."
|
jpayne@69
|
15 #endif
|
jpayne@69
|
16
|
jpayne@69
|
17 #if UCHAR_MAX != 255
|
jpayne@69
|
18 #error "Python's source code assumes C's unsigned char is an 8-bit type."
|
jpayne@69
|
19 #endif
|
jpayne@69
|
20
|
jpayne@69
|
21 #if defined(__sgi) && !defined(_SGI_MP_SOURCE)
|
jpayne@69
|
22 #define _SGI_MP_SOURCE
|
jpayne@69
|
23 #endif
|
jpayne@69
|
24
|
jpayne@69
|
25 #include <stdio.h>
|
jpayne@69
|
26 #ifndef NULL
|
jpayne@69
|
27 # error "Python.h requires that stdio.h define NULL."
|
jpayne@69
|
28 #endif
|
jpayne@69
|
29
|
jpayne@69
|
30 #include <string.h>
|
jpayne@69
|
31 #ifdef HAVE_ERRNO_H
|
jpayne@69
|
32 #include <errno.h>
|
jpayne@69
|
33 #endif
|
jpayne@69
|
34 #include <stdlib.h>
|
jpayne@69
|
35 #ifndef MS_WINDOWS
|
jpayne@69
|
36 #include <unistd.h>
|
jpayne@69
|
37 #endif
|
jpayne@69
|
38 #ifdef HAVE_CRYPT_H
|
jpayne@69
|
39 #if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
|
jpayne@69
|
40 /* Required for glibc to expose the crypt_r() function prototype. */
|
jpayne@69
|
41 # define _GNU_SOURCE
|
jpayne@69
|
42 # define _Py_GNU_SOURCE_FOR_CRYPT
|
jpayne@69
|
43 #endif
|
jpayne@69
|
44 #include <crypt.h>
|
jpayne@69
|
45 #ifdef _Py_GNU_SOURCE_FOR_CRYPT
|
jpayne@69
|
46 /* Don't leak the _GNU_SOURCE define to other headers. */
|
jpayne@69
|
47 # undef _GNU_SOURCE
|
jpayne@69
|
48 # undef _Py_GNU_SOURCE_FOR_CRYPT
|
jpayne@69
|
49 #endif
|
jpayne@69
|
50 #endif
|
jpayne@69
|
51
|
jpayne@69
|
52 /* For size_t? */
|
jpayne@69
|
53 #ifdef HAVE_STDDEF_H
|
jpayne@69
|
54 #include <stddef.h>
|
jpayne@69
|
55 #endif
|
jpayne@69
|
56
|
jpayne@69
|
57 /* CAUTION: Build setups should ensure that NDEBUG is defined on the
|
jpayne@69
|
58 * compiler command line when building Python in release mode; else
|
jpayne@69
|
59 * assert() calls won't be removed.
|
jpayne@69
|
60 */
|
jpayne@69
|
61 #include <assert.h>
|
jpayne@69
|
62
|
jpayne@69
|
63 #include "pyport.h"
|
jpayne@69
|
64 #include "pymacro.h"
|
jpayne@69
|
65
|
jpayne@69
|
66 /* A convenient way for code to know if clang's memory sanitizer is enabled. */
|
jpayne@69
|
67 #if defined(__has_feature)
|
jpayne@69
|
68 # if __has_feature(memory_sanitizer)
|
jpayne@69
|
69 # if !defined(_Py_MEMORY_SANITIZER)
|
jpayne@69
|
70 # define _Py_MEMORY_SANITIZER
|
jpayne@69
|
71 # endif
|
jpayne@69
|
72 # endif
|
jpayne@69
|
73 #endif
|
jpayne@69
|
74
|
jpayne@69
|
75 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
|
jpayne@69
|
76 * PYMALLOC_DEBUG is in error if pymalloc is not in use.
|
jpayne@69
|
77 */
|
jpayne@69
|
78 #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
|
jpayne@69
|
79 #define PYMALLOC_DEBUG
|
jpayne@69
|
80 #endif
|
jpayne@69
|
81 #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
|
jpayne@69
|
82 #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
|
jpayne@69
|
83 #endif
|
jpayne@69
|
84 #include "pymath.h"
|
jpayne@69
|
85 #include "pytime.h"
|
jpayne@69
|
86 #include "pymem.h"
|
jpayne@69
|
87
|
jpayne@69
|
88 #include "object.h"
|
jpayne@69
|
89 #include "objimpl.h"
|
jpayne@69
|
90 #include "typeslots.h"
|
jpayne@69
|
91 #include "pyhash.h"
|
jpayne@69
|
92
|
jpayne@69
|
93 #include "pydebug.h"
|
jpayne@69
|
94
|
jpayne@69
|
95 #include "bytearrayobject.h"
|
jpayne@69
|
96 #include "bytesobject.h"
|
jpayne@69
|
97 #include "unicodeobject.h"
|
jpayne@69
|
98 #include "longobject.h"
|
jpayne@69
|
99 #include "longintrepr.h"
|
jpayne@69
|
100 #include "boolobject.h"
|
jpayne@69
|
101 #include "floatobject.h"
|
jpayne@69
|
102 #include "complexobject.h"
|
jpayne@69
|
103 #include "rangeobject.h"
|
jpayne@69
|
104 #include "memoryobject.h"
|
jpayne@69
|
105 #include "tupleobject.h"
|
jpayne@69
|
106 #include "listobject.h"
|
jpayne@69
|
107 #include "dictobject.h"
|
jpayne@69
|
108 #include "odictobject.h"
|
jpayne@69
|
109 #include "enumobject.h"
|
jpayne@69
|
110 #include "setobject.h"
|
jpayne@69
|
111 #include "methodobject.h"
|
jpayne@69
|
112 #include "moduleobject.h"
|
jpayne@69
|
113 #include "funcobject.h"
|
jpayne@69
|
114 #include "classobject.h"
|
jpayne@69
|
115 #include "fileobject.h"
|
jpayne@69
|
116 #include "pycapsule.h"
|
jpayne@69
|
117 #include "traceback.h"
|
jpayne@69
|
118 #include "sliceobject.h"
|
jpayne@69
|
119 #include "cellobject.h"
|
jpayne@69
|
120 #include "iterobject.h"
|
jpayne@69
|
121 #include "genobject.h"
|
jpayne@69
|
122 #include "descrobject.h"
|
jpayne@69
|
123 #include "warnings.h"
|
jpayne@69
|
124 #include "weakrefobject.h"
|
jpayne@69
|
125 #include "structseq.h"
|
jpayne@69
|
126 #include "namespaceobject.h"
|
jpayne@69
|
127 #include "picklebufobject.h"
|
jpayne@69
|
128
|
jpayne@69
|
129 #include "codecs.h"
|
jpayne@69
|
130 #include "pyerrors.h"
|
jpayne@69
|
131
|
jpayne@69
|
132 #include "cpython/initconfig.h"
|
jpayne@69
|
133 #include "pystate.h"
|
jpayne@69
|
134 #include "context.h"
|
jpayne@69
|
135
|
jpayne@69
|
136 #include "pyarena.h"
|
jpayne@69
|
137 #include "modsupport.h"
|
jpayne@69
|
138 #include "compile.h"
|
jpayne@69
|
139 #include "pythonrun.h"
|
jpayne@69
|
140 #include "pylifecycle.h"
|
jpayne@69
|
141 #include "ceval.h"
|
jpayne@69
|
142 #include "sysmodule.h"
|
jpayne@69
|
143 #include "osmodule.h"
|
jpayne@69
|
144 #include "intrcheck.h"
|
jpayne@69
|
145 #include "import.h"
|
jpayne@69
|
146
|
jpayne@69
|
147 #include "abstract.h"
|
jpayne@69
|
148 #include "bltinmodule.h"
|
jpayne@69
|
149
|
jpayne@69
|
150 #include "eval.h"
|
jpayne@69
|
151
|
jpayne@69
|
152 #include "pyctype.h"
|
jpayne@69
|
153 #include "pystrtod.h"
|
jpayne@69
|
154 #include "pystrcmp.h"
|
jpayne@69
|
155 #include "dtoa.h"
|
jpayne@69
|
156 #include "fileutils.h"
|
jpayne@69
|
157 #include "pyfpe.h"
|
jpayne@69
|
158 #include "tracemalloc.h"
|
jpayne@69
|
159
|
jpayne@69
|
160 #endif /* !Py_PYTHON_H */
|