Python.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. #ifdef HAVE_CRYPT_H
  31. #if defined(HAVE_CRYPT_R) && !defined(_GNU_SOURCE)
  32. /* Required for glibc to expose the crypt_r() function prototype. */
  33. # define _GNU_SOURCE
  34. # define _Py_GNU_SOURCE_FOR_CRYPT
  35. #endif
  36. #include <crypt.h>
  37. #ifdef _Py_GNU_SOURCE_FOR_CRYPT
  38. /* Don't leak the _GNU_SOURCE define to other headers. */
  39. # undef _GNU_SOURCE
  40. # undef _Py_GNU_SOURCE_FOR_CRYPT
  41. #endif
  42. #endif
  43. /* For size_t? */
  44. #ifdef HAVE_STDDEF_H
  45. #include <stddef.h>
  46. #endif
  47. /* CAUTION: Build setups should ensure that NDEBUG is defined on the
  48. * compiler command line when building Python in release mode; else
  49. * assert() calls won't be removed.
  50. */
  51. #include <assert.h>
  52. #include "pyport.h"
  53. #include "pymacro.h"
  54. /* A convenient way for code to know if clang's memory sanitizer is enabled. */
  55. #if defined(__has_feature)
  56. # if __has_feature(memory_sanitizer)
  57. # if !defined(_Py_MEMORY_SANITIZER)
  58. # define _Py_MEMORY_SANITIZER
  59. # endif
  60. # endif
  61. #endif
  62. /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
  63. * PYMALLOC_DEBUG is in error if pymalloc is not in use.
  64. */
  65. #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
  66. #define PYMALLOC_DEBUG
  67. #endif
  68. #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
  69. #error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
  70. #endif
  71. #include "pymath.h"
  72. #include "pytime.h"
  73. #include "pymem.h"
  74. #include "object.h"
  75. #include "objimpl.h"
  76. #include "typeslots.h"
  77. #include "pyhash.h"
  78. #include "pydebug.h"
  79. #include "bytearrayobject.h"
  80. #include "bytesobject.h"
  81. #include "unicodeobject.h"
  82. #include "longobject.h"
  83. #include "longintrepr.h"
  84. #include "boolobject.h"
  85. #include "floatobject.h"
  86. #include "complexobject.h"
  87. #include "rangeobject.h"
  88. #include "memoryobject.h"
  89. #include "tupleobject.h"
  90. #include "listobject.h"
  91. #include "dictobject.h"
  92. #include "odictobject.h"
  93. #include "enumobject.h"
  94. #include "setobject.h"
  95. #include "methodobject.h"
  96. #include "moduleobject.h"
  97. #include "funcobject.h"
  98. #include "classobject.h"
  99. #include "fileobject.h"
  100. #include "pycapsule.h"
  101. #include "traceback.h"
  102. #include "sliceobject.h"
  103. #include "cellobject.h"
  104. #include "iterobject.h"
  105. #include "genobject.h"
  106. #include "descrobject.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 "cpython/initconfig.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 "dtoa.h"
  134. #include "fileutils.h"
  135. #include "pyfpe.h"
  136. #include "tracemalloc.h"
  137. #endif /* !Py_PYTHON_H */