Guido van Rossum | d27b4f2 | 1997-05-02 04:00:11 +0000 | [diff] [blame] | 1 | #ifndef Py_PYTHON_H |
2 | #define Py_PYTHON_H | ||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 3 | /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ |
4 | |||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 5 | /* Include nearly all Python header files */ |
6 | |||||
Guido van Rossum | f1176c4 | 1999-01-03 12:40:24 +0000 | [diff] [blame] | 7 | #include "patchlevel.h" |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 8 | #include "pyconfig.h" |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 9 | #include "pymacconfig.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 10 | |
Fred Drake | d5fadf7 | 2000-09-26 05:46:01 +0000 | [diff] [blame] | 11 | #include <limits.h> |
Fred Drake | d5fadf7 | 2000-09-26 05:46:01 +0000 | [diff] [blame] | 12 | |
Skip Montanaro | ac4ea13 | 2003-12-22 16:31:41 +0000 | [diff] [blame] | 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 | ||||
Tim Peters | 0490fe9 | 2003-12-22 18:10:51 +0000 | [diff] [blame] | 18 | #error "Python's source code assumes C's unsigned char is an 8-bit type." |
Skip Montanaro | ac4ea13 | 2003-12-22 16:31:41 +0000 | [diff] [blame] | 19 | #endif |
20 | |||||
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 21 | #if defined(__sgi) && !defined(_SGI_MP_SOURCE) |
Guido van Rossum | 90ce848 | 1998-05-26 18:38:07 +0000 | [diff] [blame] | 22 | #define _SGI_MP_SOURCE |
23 | #endif | ||||
24 | |||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 25 | #include <stdio.h> |
Tim Peters | 4826a89 | 2000-09-10 01:02:41 +0000 | [diff] [blame] | 26 | #ifndef NULL |
27 | # error "Python.h requires that stdio.h define NULL." | ||||
28 | #endif | ||||
29 | |||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 30 | #include <string.h> |
Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 31 | #ifdef HAVE_ERRNO_H |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 32 | #include <errno.h> |
Thomas Wouters | 477c8d5 | 2006-05-27 19:21:47 +0000 | [diff] [blame] | 33 | #endif |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 34 | #include <stdlib.h> |
Benjamin Peterson | ea13740 | 2018-09-13 21:57:31 -0700 | [diff] [blame] | 35 | #ifndef MS_WINDOWS |
Martin v. Löwis | cdc4451 | 2002-01-12 11:05:12 +0000 | [diff] [blame] | 36 | #include <unistd.h> |
37 | #endif | ||||
stratakis | e768c86 | 2018-01-23 16:11:24 +0100 | [diff] [blame] | 38 | #ifdef HAVE_CRYPT_H |
Gregory P. Smith | 387512c | 2018-12-30 15:42:32 -0800 | [diff] [blame] | 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 | ||||
stratakis | e768c86 | 2018-01-23 16:11:24 +0100 | [diff] [blame] | 44 | #include <crypt.h> |
Gregory P. Smith | 387512c | 2018-12-30 15:42:32 -0800 | [diff] [blame] | 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 | ||||
stratakis | e768c86 | 2018-01-23 16:11:24 +0100 | [diff] [blame] | 50 | #endif |
Guido van Rossum | b2c075b | 2001-07-15 16:58:05 +0000 | [diff] [blame] | 51 | |
Amaury Forgeot d'Arc | fdfe62d | 2008-06-17 20:36:03 +0000 | [diff] [blame] | 52 | /* For size_t? */ |
Martin v. Löwis | fe393f4 | 2004-07-27 15:57:24 +0000 | [diff] [blame] | 53 | #ifdef HAVE_STDDEF_H |
54 | #include <stddef.h> | ||||
55 | #endif | ||||
56 | |||||
Tim Peters | 5defb17 | 2001-12-04 20:06:11 +0000 | [diff] [blame] | 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 | */ | ||||
Tim Peters | 8315ea5 | 2000-07-23 19:28:35 +0000 | [diff] [blame] | 61 | #include <assert.h> |
62 | |||||
Martin v. Löwis | 1e1fcef | 2002-05-15 18:24:06 +0000 | [diff] [blame] | 63 | #include "pyport.h" |
Victor Stinner | dfb866d | 2011-09-29 01:12:24 +0200 | [diff] [blame] | 64 | #include "pymacro.h" |
Martin v. Löwis | 1e1fcef | 2002-05-15 18:24:06 +0000 | [diff] [blame] | 65 | |
Gregory P. Smith | 1584a00 | 2018-11-12 12:07:14 -0800 | [diff] [blame] | 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) | ||||
Gregory P. Smith | 3015fb8 | 2018-11-12 22:01:22 -0800 | [diff] [blame] | 69 | # if !defined(_Py_MEMORY_SANITIZER) |
70 | # define _Py_MEMORY_SANITIZER | ||||
Gregory P. Smith | 1584a00 | 2018-11-12 12:07:14 -0800 | [diff] [blame] | 71 | # endif |
72 | # endif | ||||
73 | #endif | ||||
74 | |||||
Tim Peters | ddea208 | 2002-03-23 10:03:50 +0000 | [diff] [blame] | 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 | ||||
Christian Heimes | 53876d9 | 2008-04-19 00:31:39 +0000 | [diff] [blame] | 84 | #include "pymath.h" |
Alexander Belopolsky | 6fc4ade | 2010-08-05 17:34:27 +0000 | [diff] [blame] | 85 | #include "pytime.h" |
Peter Schneider-Kamp | 25f6894 | 2000-07-31 22:19:30 +0000 | [diff] [blame] | 86 | #include "pymem.h" |
87 | |||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 88 | #include "object.h" |
89 | #include "objimpl.h" | ||||
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 90 | #include "typeslots.h" |
Christian Heimes | 985ecdc | 2013-11-20 11:46:18 +0100 | [diff] [blame] | 91 | #include "pyhash.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 92 | |
93 | #include "pydebug.h" | ||||
94 | |||||
Christian Heimes | 2c9c7a5 | 2008-05-26 13:42:13 +0000 | [diff] [blame] | 95 | #include "bytearrayobject.h" |
Guido van Rossum | 4dfe8a1 | 2006-04-22 23:28:04 +0000 | [diff] [blame] | 96 | #include "bytesobject.h" |
Guido van Rossum | 9e896b3 | 2000-04-05 20:11:21 +0000 | [diff] [blame] | 97 | #include "unicodeobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 98 | #include "longobject.h" |
Martin v. Löwis | 9f2e346 | 2007-07-21 17:22:18 +0000 | [diff] [blame] | 99 | #include "longintrepr.h" |
100 | #include "boolobject.h" | ||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 101 | #include "floatobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 102 | #include "complexobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 103 | #include "rangeobject.h" |
Travis E. Oliphant | b99f762 | 2007-08-18 11:21:56 +0000 | [diff] [blame] | 104 | #include "memoryobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 105 | #include "tupleobject.h" |
106 | #include "listobject.h" | ||||
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 107 | #include "dictobject.h" |
Eric Snow | 47db717 | 2015-05-29 22:21:39 -0600 | [diff] [blame] | 108 | #include "odictobject.h" |
Guido van Rossum | 7dab242 | 2002-04-26 19:40:56 +0000 | [diff] [blame] | 109 | #include "enumobject.h" |
Raymond Hettinger | a690a99 | 2003-11-16 16:17:49 +0000 | [diff] [blame] | 110 | #include "setobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 111 | #include "methodobject.h" |
112 | #include "moduleobject.h" | ||||
113 | #include "funcobject.h" | ||||
114 | #include "classobject.h" | ||||
115 | #include "fileobject.h" | ||||
Benjamin Peterson | b173f78 | 2009-05-05 22:31:58 +0000 | [diff] [blame] | 116 | #include "pycapsule.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 117 | #include "traceback.h" |
118 | #include "sliceobject.h" | ||||
Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 119 | #include "cellobject.h" |
Guido van Rossum | 59d1d2b | 2001-04-20 19:13:02 +0000 | [diff] [blame] | 120 | #include "iterobject.h" |
Martin v. Löwis | 8d97e33 | 2004-06-27 15:43:12 +0000 | [diff] [blame] | 121 | #include "genobject.h" |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 122 | #include "descrobject.h" |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 123 | #include "warnings.h" |
Fred Drake | 19bc578 | 2001-10-05 21:55:19 +0000 | [diff] [blame] | 124 | #include "weakrefobject.h" |
Georg Brandl | 71c23d4 | 2010-11-30 09:30:54 +0000 | [diff] [blame] | 125 | #include "structseq.h" |
Barry Warsaw | 409da15 | 2012-06-03 16:18:47 -0400 | [diff] [blame] | 126 | #include "namespaceobject.h" |
Antoine Pitrou | 91f4380 | 2019-05-26 17:10:09 +0200 | [diff] [blame] | 127 | #include "picklebufobject.h" |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 128 | |
Guido van Rossum | bd7dfbc | 2000-03-10 22:34:00 +0000 | [diff] [blame] | 129 | #include "codecs.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 130 | #include "pyerrors.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 131 | |
Victor Stinner | 331a6a5 | 2019-05-27 16:39:22 +0200 | [diff] [blame] | 132 | #include "cpython/initconfig.h" |
Guido van Rossum | 618af4b | 1997-07-18 23:59:26 +0000 | [diff] [blame] | 133 | #include "pystate.h" |
Yury Selivanov | f23746a | 2018-01-22 19:11:18 -0500 | [diff] [blame] | 134 | #include "context.h" |
Guido van Rossum | 618af4b | 1997-07-18 23:59:26 +0000 | [diff] [blame] | 135 | |
Neal Norwitz | adb69fc | 2005-12-17 20:54:49 +0000 | [diff] [blame] | 136 | #include "pyarena.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 137 | #include "modsupport.h" |
Eric Snow | 6b4be19 | 2017-05-22 21:36:03 -0700 | [diff] [blame] | 138 | #include "compile.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 139 | #include "pythonrun.h" |
Nick Coghlan | d600951 | 2014-11-20 21:39:37 +1000 | [diff] [blame] | 140 | #include "pylifecycle.h" |
Tim Peters | 5ba5866 | 2001-07-16 02:29:45 +0000 | [diff] [blame] | 141 | #include "ceval.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 142 | #include "sysmodule.h" |
Ethan Furman | 410ef8e | 2016-06-04 12:06:26 -0700 | [diff] [blame] | 143 | #include "osmodule.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 144 | #include "intrcheck.h" |
145 | #include "import.h" | ||||
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 146 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 147 | #include "abstract.h" |
Benjamin Peterson | 8bc5b68 | 2009-05-09 18:10:51 +0000 | [diff] [blame] | 148 | #include "bltinmodule.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 149 | |
Skip Montanaro | 6e098a1 | 2004-03-13 23:11:44 +0000 | [diff] [blame] | 150 | #include "eval.h" |
151 | |||||
Eric Smith | 6dc46f5 | 2009-04-27 20:39:49 +0000 | [diff] [blame] | 152 | #include "pyctype.h" |
Martin v. Löwis | 737ea82 | 2004-06-08 18:52:54 +0000 | [diff] [blame] | 153 | #include "pystrtod.h" |
Christian Heimes | 99170a5 | 2007-12-19 02:07:34 +0000 | [diff] [blame] | 154 | #include "pystrcmp.h" |
Mark Dickinson | b08a53a | 2009-04-16 19:52:09 +0000 | [diff] [blame] | 155 | #include "dtoa.h" |
Victor Stinner | 4e31443 | 2010-10-07 21:45:39 +0000 | [diff] [blame] | 156 | #include "fileutils.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 157 | #include "pyfpe.h" |
Victor Stinner | 6279c1c | 2018-10-25 15:54:13 +0200 | [diff] [blame] | 158 | #include "tracemalloc.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 159 | |
Guido van Rossum | d27b4f2 | 1997-05-02 04:00:11 +0000 | [diff] [blame] | 160 | #endif /* !Py_PYTHON_H */ |