Chris@87: #ifndef Py_PYTHON_H Chris@87: #define Py_PYTHON_H Chris@87: /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ Chris@87: Chris@87: /* Include nearly all Python header files */ Chris@87: Chris@87: #include "patchlevel.h" Chris@87: #include "pyconfig.h" Chris@87: #include "pymacconfig.h" Chris@87: Chris@87: /* Cyclic gc is always enabled, starting with release 2.3a1. Supply the Chris@87: * old symbol for the benefit of extension modules written before then Chris@87: * that may be conditionalizing on it. The core doesn't use it anymore. Chris@87: */ Chris@87: #ifndef WITH_CYCLE_GC Chris@87: #define WITH_CYCLE_GC 1 Chris@87: #endif Chris@87: Chris@87: #include Chris@87: Chris@87: #ifndef UCHAR_MAX Chris@87: #error "Something's broken. UCHAR_MAX should be defined in limits.h." Chris@87: #endif Chris@87: Chris@87: #if UCHAR_MAX != 255 Chris@87: #error "Python's source code assumes C's unsigned char is an 8-bit type." Chris@87: #endif Chris@87: Chris@87: #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) Chris@87: #define _SGI_MP_SOURCE Chris@87: #endif Chris@87: Chris@87: #include Chris@87: #ifndef NULL Chris@87: # error "Python.h requires that stdio.h define NULL." Chris@87: #endif Chris@87: Chris@87: #include Chris@87: #ifdef HAVE_ERRNO_H Chris@87: #include Chris@87: #endif Chris@87: #include Chris@87: #ifdef HAVE_UNISTD_H Chris@87: #include Chris@87: #endif Chris@87: Chris@87: /* For size_t? */ Chris@87: #ifdef HAVE_STDDEF_H Chris@87: #include Chris@87: #endif Chris@87: Chris@87: /* CAUTION: Build setups should ensure that NDEBUG is defined on the Chris@87: * compiler command line when building Python in release mode; else Chris@87: * assert() calls won't be removed. Chris@87: */ Chris@87: #include Chris@87: Chris@87: #include "pyport.h" Chris@87: Chris@87: /* pyconfig.h or pyport.h may or may not define DL_IMPORT */ Chris@87: #ifndef DL_IMPORT /* declarations for DLL import/export */ Chris@87: #define DL_IMPORT(RTYPE) RTYPE Chris@87: #endif Chris@87: #ifndef DL_EXPORT /* declarations for DLL import/export */ Chris@87: #define DL_EXPORT(RTYPE) RTYPE Chris@87: #endif Chris@87: Chris@87: /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG. Chris@87: * PYMALLOC_DEBUG is in error if pymalloc is not in use. Chris@87: */ Chris@87: #if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG) Chris@87: #define PYMALLOC_DEBUG Chris@87: #endif Chris@87: #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) Chris@87: #error "PYMALLOC_DEBUG requires WITH_PYMALLOC" Chris@87: #endif Chris@87: #include "pymath.h" Chris@87: #include "pymem.h" Chris@87: Chris@87: #include "object.h" Chris@87: #include "objimpl.h" Chris@87: Chris@87: #include "pydebug.h" Chris@87: Chris@87: #include "unicodeobject.h" Chris@87: #include "intobject.h" Chris@87: #include "boolobject.h" Chris@87: #include "longobject.h" Chris@87: #include "floatobject.h" Chris@87: #ifndef WITHOUT_COMPLEX Chris@87: #include "complexobject.h" Chris@87: #endif Chris@87: #include "rangeobject.h" Chris@87: #include "stringobject.h" Chris@87: #include "memoryobject.h" Chris@87: #include "bufferobject.h" Chris@87: #include "bytesobject.h" Chris@87: #include "bytearrayobject.h" Chris@87: #include "tupleobject.h" Chris@87: #include "listobject.h" Chris@87: #include "dictobject.h" Chris@87: #include "enumobject.h" Chris@87: #include "setobject.h" Chris@87: #include "methodobject.h" Chris@87: #include "moduleobject.h" Chris@87: #include "funcobject.h" Chris@87: #include "classobject.h" Chris@87: #include "fileobject.h" Chris@87: #include "cobject.h" Chris@87: #include "pycapsule.h" Chris@87: #include "traceback.h" Chris@87: #include "sliceobject.h" Chris@87: #include "cellobject.h" Chris@87: #include "iterobject.h" Chris@87: #include "genobject.h" Chris@87: #include "descrobject.h" Chris@87: #include "warnings.h" Chris@87: #include "weakrefobject.h" Chris@87: Chris@87: #include "codecs.h" Chris@87: #include "pyerrors.h" Chris@87: Chris@87: #include "pystate.h" Chris@87: Chris@87: #include "pyarena.h" Chris@87: #include "modsupport.h" Chris@87: #include "pythonrun.h" Chris@87: #include "ceval.h" Chris@87: #include "sysmodule.h" Chris@87: #include "intrcheck.h" Chris@87: #include "import.h" Chris@87: Chris@87: #include "abstract.h" Chris@87: Chris@87: #include "compile.h" Chris@87: #include "eval.h" Chris@87: Chris@87: #include "pyctype.h" Chris@87: #include "pystrtod.h" Chris@87: #include "pystrcmp.h" Chris@87: #include "dtoa.h" Chris@87: Chris@87: /* _Py_Mangle is defined in compile.c */ Chris@87: PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); Chris@87: Chris@87: /* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */ Chris@87: #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) Chris@87: Chris@87: /* PyArg_NoArgs should not be necessary. Chris@87: Set ml_flags in the PyMethodDef to METH_NOARGS. */ Chris@87: #define PyArg_NoArgs(v) PyArg_Parse(v, "") Chris@87: Chris@87: /* Argument must be a char or an int in [-128, 127] or [0, 255]. */ Chris@87: #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff)) Chris@87: Chris@87: #include "pyfpe.h" Chris@87: Chris@87: /* These definitions must match corresponding definitions in graminit.h. Chris@87: There's code in compile.c that checks that they are the same. */ Chris@87: #define Py_single_input 256 Chris@87: #define Py_file_input 257 Chris@87: #define Py_eval_input 258 Chris@87: Chris@87: #ifdef HAVE_PTH Chris@87: /* GNU pth user-space thread support */ Chris@87: #include Chris@87: #endif Chris@87: Chris@87: /* Define macros for inline documentation. */ Chris@87: #define PyDoc_VAR(name) static char name[] Chris@87: #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str) Chris@87: #ifdef WITH_DOC_STRINGS Chris@87: #define PyDoc_STR(str) str Chris@87: #else Chris@87: #define PyDoc_STR(str) "" Chris@87: #endif Chris@87: Chris@87: #endif /* !Py_PYTHON_H */