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 "longobject.h"
  46. #include "cpython/longintrepr.h"
  47. #include "boolobject.h"
  48. #include "floatobject.h"
  49. #include "complexobject.h"
  50. #include "rangeobject.h"
  51. #include "memoryobject.h"
  52. #include "tupleobject.h"
  53. #include "listobject.h"
  54. #include "dictobject.h"
  55. #include "cpython/odictobject.h"
  56. #include "enumobject.h"
  57. #include "setobject.h"
  58. #include "methodobject.h"
  59. #include "moduleobject.h"
  60. #include "cpython/funcobject.h"
  61. #include "cpython/classobject.h"
  62. #include "fileobject.h"
  63. #include "pycapsule.h"
  64. #include "cpython/code.h"
  65. #include "pyframe.h"
  66. #include "traceback.h"
  67. #include "sliceobject.h"
  68. #include "cpython/cellobject.h"
  69. #include "iterobject.h"
  70. #include "cpython/initconfig.h"
  71. #include "pystate.h"
  72. #include "cpython/genobject.h"
  73. #include "descrobject.h"
  74. #include "genericaliasobject.h"
  75. #include "warnings.h"
  76. #include "weakrefobject.h"
  77. #include "structseq.h"
  78. #include "cpython/picklebufobject.h"
  79. #include "cpython/pytime.h"
  80. #include "codecs.h"
  81. #include "pyerrors.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 */