Python.h 2.8 KB

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