• 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 #ifdef HAVE_UNISTD_H
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 #include "pyatomic.h"
76 
77 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
78  *  PYMALLOC_DEBUG is in error if pymalloc is not in use.
79  */
80 #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
81 #define PYMALLOC_DEBUG
82 #endif
83 #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
84 #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
85 #endif
86 #include "pymath.h"
87 #include "pytime.h"
88 #include "pymem.h"
89 
90 #include "object.h"
91 #include "objimpl.h"
92 #include "typeslots.h"
93 #include "pyhash.h"
94 
95 #include "pydebug.h"
96 
97 #include "bytearrayobject.h"
98 #include "bytesobject.h"
99 #include "unicodeobject.h"
100 #include "longobject.h"
101 #include "longintrepr.h"
102 #include "boolobject.h"
103 #include "floatobject.h"
104 #include "complexobject.h"
105 #include "rangeobject.h"
106 #include "memoryobject.h"
107 #include "tupleobject.h"
108 #include "listobject.h"
109 #include "dictobject.h"
110 #include "odictobject.h"
111 #include "enumobject.h"
112 #include "setobject.h"
113 #include "methodobject.h"
114 #include "moduleobject.h"
115 #include "funcobject.h"
116 #include "classobject.h"
117 #include "fileobject.h"
118 #include "pycapsule.h"
119 #include "traceback.h"
120 #include "sliceobject.h"
121 #include "cellobject.h"
122 #include "iterobject.h"
123 #include "genobject.h"
124 #include "descrobject.h"
125 #include "warnings.h"
126 #include "weakrefobject.h"
127 #include "structseq.h"
128 #include "namespaceobject.h"
129 
130 #include "codecs.h"
131 #include "pyerrors.h"
132 
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 
159 #endif /* !Py_PYTHON_H */
160