|
| 1 | +// Entry point of the Python C API. |
| 2 | +// C extensions should only #include <Python.h>, and not include directly |
| 3 | +// the other Python header files included by <Python.h>. |
| 4 | + |
| 5 | +#ifndef Py_PYTHON_H |
| 6 | +#define Py_PYTHON_H |
| 7 | + |
| 8 | +// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { |
| 9 | + |
| 10 | +// Include Python header files |
| 11 | +#include "patchlevel.h" |
| 12 | +#include "pyconfig.h" |
| 13 | +#include "pymacconfig.h" |
| 14 | + |
| 15 | +#if defined(__sgi) && !defined(_SGI_MP_SOURCE) |
| 16 | +# define _SGI_MP_SOURCE |
| 17 | +#endif |
| 18 | + |
| 19 | +// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python |
| 20 | +// headers, but kept for backward compatibility. They are excluded from the |
| 21 | +// limited C API of Python 3.11. |
| 22 | +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 |
| 23 | +# include <stdlib.h> |
| 24 | +# include <stdio.h> // FILE* |
| 25 | +# include <errno.h> // errno |
| 26 | +# include <string.h> // memcpy() |
| 27 | +#endif |
| 28 | +#ifndef MS_WINDOWS |
| 29 | +# include <unistd.h> |
| 30 | +#endif |
| 31 | +#ifdef HAVE_STDDEF_H |
| 32 | +# include <stddef.h> // size_t |
| 33 | +#endif |
| 34 | + |
| 35 | +#include <assert.h> // assert() |
| 36 | +#include <wchar.h> // wchar_t |
| 37 | + |
| 38 | +#include "pyport.h" |
| 39 | +#include "pymacro.h" |
| 40 | +#include "pymath.h" |
| 41 | +#include "pymem.h" |
| 42 | +#include "pytypedefs.h" |
| 43 | +#include "pybuffer.h" |
| 44 | +#include "object.h" |
| 45 | +#include "objimpl.h" |
| 46 | +#include "typeslots.h" |
| 47 | +#include "pyhash.h" |
| 48 | +#include "cpython/pydebug.h" |
| 49 | +#include "bytearrayobject.h" |
| 50 | +#include "bytesobject.h" |
| 51 | +#include "unicodeobject.h" |
| 52 | +#include "cpython/initconfig.h" |
| 53 | +#include "pystate.h" |
| 54 | +#include "pyerrors.h" |
| 55 | +#include "longobject.h" |
| 56 | +#include "cpython/longintrepr.h" |
| 57 | +#include "boolobject.h" |
| 58 | +#include "floatobject.h" |
| 59 | +#include "complexobject.h" |
| 60 | +#include "rangeobject.h" |
| 61 | +#include "memoryobject.h" |
| 62 | +#include "tupleobject.h" |
| 63 | +#include "listobject.h" |
| 64 | +#include "dictobject.h" |
| 65 | +#include "cpython/odictobject.h" |
| 66 | +#include "enumobject.h" |
| 67 | +#include "setobject.h" |
| 68 | +#include "methodobject.h" |
| 69 | +#include "moduleobject.h" |
| 70 | +#include "cpython/funcobject.h" |
| 71 | +#include "cpython/classobject.h" |
| 72 | +#include "fileobject.h" |
| 73 | +#include "pycapsule.h" |
| 74 | +#include "cpython/code.h" |
| 75 | +#include "pyframe.h" |
| 76 | +#include "traceback.h" |
| 77 | +#include "sliceobject.h" |
| 78 | +#include "cpython/cellobject.h" |
| 79 | +#include "iterobject.h" |
| 80 | +#include "cpython/genobject.h" |
| 81 | +#include "descrobject.h" |
| 82 | +#include "genericaliasobject.h" |
| 83 | +#include "warnings.h" |
| 84 | +#include "weakrefobject.h" |
| 85 | +#include "structseq.h" |
| 86 | +#include "cpython/picklebufobject.h" |
| 87 | +#include "cpython/pytime.h" |
| 88 | +#include "codecs.h" |
| 89 | +#include "pythread.h" |
| 90 | +#include "cpython/context.h" |
| 91 | +#include "modsupport.h" |
| 92 | +#include "compile.h" |
| 93 | +#include "pythonrun.h" |
| 94 | +#include "pylifecycle.h" |
| 95 | +#include "ceval.h" |
| 96 | +#include "sysmodule.h" |
| 97 | +#include "osmodule.h" |
| 98 | +#include "intrcheck.h" |
| 99 | +#include "import.h" |
| 100 | +#include "abstract.h" |
| 101 | +#include "bltinmodule.h" |
| 102 | +#include "cpython/pyctype.h" |
| 103 | +#include "pystrtod.h" |
| 104 | +#include "pystrcmp.h" |
| 105 | +#include "fileutils.h" |
| 106 | +#include "cpython/pyfpe.h" |
| 107 | +#include "tracemalloc.h" |
| 108 | + |
| 109 | +#endif /* !Py_PYTHON_H */ |
0 commit comments