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