Python.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #ifndef Py_PYTHON_H
  2. #define Py_PYTHON_H
  3. /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
  4. /* Include nearly all Python header files */
  5. #include "patchlevel.h"
  6. #include "pyconfig.h"
  7. #include "pymacconfig.h"
  8. #include <limits.h>
  9. #ifndef UCHAR_MAX
  10. #error "Something's broken. UCHAR_MAX should be defined in limits.h."
  11. #endif
  12. #if UCHAR_MAX != 255
  13. #error "Python's source code assumes C's unsigned char is an 8-bit type."
  14. #endif
  15. #if defined(__sgi) && !defined(_SGI_MP_SOURCE)
  16. #define _SGI_MP_SOURCE
  17. #endif
  18. #include <stdio.h>
  19. #ifndef NULL
  20. # error "Python.h requires that stdio.h define NULL."
  21. #endif
  22. #include <string.h>
  23. #ifdef HAVE_ERRNO_H
  24. #include <errno.h>
  25. #endif
  26. #include <stdlib.h>
  27. #ifndef MS_WINDOWS
  28. #include <unistd.h>
  29. #endif
  30. /* For size_t? */
  31. #ifdef HAVE_STDDEF_H
  32. #include <stddef.h>
  33. #endif
  34. /* CAUTION: Build setups should ensure that NDEBUG is defined on the
  35. * compiler command line when building Python in release mode; else
  36. * assert() calls won't be removed.
  37. */
  38. #include <assert.h>
  39. #include "pyport.h"
  40. #include "pymacro.h"
  41. /* A convenient way for code to know if sanitizers are enabled. */
  42. #if defined(__has_feature)
  43. # if __has_feature(memory_sanitizer)
  44. # if !defined(_Py_MEMORY_SANITIZER)
  45. # define _Py_MEMORY_SANITIZER
  46. # endif
  47. # endif
  48. # if __has_feature(address_sanitizer)
  49. # if !defined(_Py_ADDRESS_SANITIZER)
  50. # define _Py_ADDRESS_SANITIZER
  51. # endif
  52. # endif
  53. #elif defined(__GNUC__)
  54. # if defined(__SANITIZE_ADDRESS__)
  55. # define _Py_ADDRESS_SANITIZER
  56. # endif
  57. #endif
  58. /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
  59. * PYMALLOC_DEBUG is in error if pymalloc is not in use.
  60. */
  61. #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
  62. #define PYMALLOC_DEBUG
  63. #endif
  64. #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
  65. #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
  66. #endif
  67. #include "pymath.h"
  68. #include "pytime.h"
  69. #include "pymem.h"
  70. #include "object.h"
  71. #include "objimpl.h"
  72. #include "typeslots.h"
  73. #include "pyhash.h"
  74. #include "pydebug.h"
  75. #include "bytearrayobject.h"
  76. #include "bytesobject.h"
  77. #include "unicodeobject.h"
  78. #include "longobject.h"
  79. #include "longintrepr.h"
  80. #include "boolobject.h"
  81. #include "floatobject.h"
  82. #include "complexobject.h"
  83. #include "rangeobject.h"
  84. #include "memoryobject.h"
  85. #include "tupleobject.h"
  86. #include "listobject.h"
  87. #include "dictobject.h"
  88. #include "odictobject.h"
  89. #include "enumobject.h"
  90. #include "setobject.h"
  91. #include "methodobject.h"
  92. #include "moduleobject.h"
  93. #include "funcobject.h"
  94. #include "classobject.h"
  95. #include "fileobject.h"
  96. #include "pycapsule.h"
  97. #include "code.h"
  98. #include "pyframe.h"
  99. #include "traceback.h"
  100. #include "sliceobject.h"
  101. #include "cellobject.h"
  102. #include "iterobject.h"
  103. #include "cpython/initconfig.h"
  104. #include "genobject.h"
  105. #include "descrobject.h"
  106. #include "genericaliasobject.h"
  107. #include "warnings.h"
  108. #include "weakrefobject.h"
  109. #include "structseq.h"
  110. #include "namespaceobject.h"
  111. #include "picklebufobject.h"
  112. #include "codecs.h"
  113. #include "pyerrors.h"
  114. #include "pythread.h"
  115. #include "pystate.h"
  116. #include "context.h"
  117. #include "pyarena.h"
  118. #include "modsupport.h"
  119. #include "compile.h"
  120. #include "pythonrun.h"
  121. #include "pylifecycle.h"
  122. #include "ceval.h"
  123. #include "sysmodule.h"
  124. #include "osmodule.h"
  125. #include "intrcheck.h"
  126. #include "import.h"
  127. #include "abstract.h"
  128. #include "bltinmodule.h"
  129. #include "eval.h"
  130. #include "pyctype.h"
  131. #include "pystrtod.h"
  132. #include "pystrcmp.h"
  133. #include "fileutils.h"
  134. #include "pyfpe.h"
  135. #include "tracemalloc.h"
  136. #endif /* !Py_PYTHON_H */