Move setting of ioready 'wait' earlier in call chain, to
[python/dscho.git] / Include / Python.h
blob26d221160b4f41b4539b8de449cc1c2490e3ef00
1 #ifndef Py_PYTHON_H
2 #define Py_PYTHON_H
3 /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
5 /* Include nearly all Python header files */
7 #include "patchlevel.h"
8 #include "pyconfig.h"
10 /* Cyclic gc is always enabled, starting with release 2.3a1. Supply the
11 * old symbol for the benefit of extension modules written before then
12 * that may be conditionalizing on it. The core doesn't use it anymore.
14 #ifndef WITH_CYCLE_GC
15 #define WITH_CYCLE_GC 1
16 #endif
18 #ifdef HAVE_LIMITS_H
19 #include <limits.h>
20 #else
21 #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?"
22 #endif
24 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
25 #define _SGI_MP_SOURCE
26 #endif
28 #include <stdio.h>
29 #ifndef NULL
30 # error "Python.h requires that stdio.h define NULL."
31 #endif
33 #include <string.h>
34 #include <errno.h>
35 #ifdef HAVE_STDLIB_H
36 #include <stdlib.h>
37 #endif
38 #ifdef HAVE_UNISTD_H
39 #include <unistd.h>
40 #endif
42 /* CAUTION: Build setups should ensure that NDEBUG is defined on the
43 * compiler command line when building Python in release mode; else
44 * assert() calls won't be removed.
46 #include <assert.h>
48 #include "pyport.h"
50 /* pyconfig.h or pyport.h may or may not define DL_IMPORT */
51 #ifndef DL_IMPORT /* declarations for DLL import/export */
52 #define DL_IMPORT(RTYPE) RTYPE
53 #endif
54 #ifndef DL_EXPORT /* declarations for DLL import/export */
55 #define DL_EXPORT(RTYPE) RTYPE
56 #endif
58 /* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
59 * PYMALLOC_DEBUG is in error if pymalloc is not in use.
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 "pymem.h"
69 #include "object.h"
70 #include "objimpl.h"
72 #include "pydebug.h"
74 #include "unicodeobject.h"
75 #include "intobject.h"
76 #include "boolobject.h"
77 #include "longobject.h"
78 #include "floatobject.h"
79 #ifndef WITHOUT_COMPLEX
80 #include "complexobject.h"
81 #endif
82 #include "rangeobject.h"
83 #include "stringobject.h"
84 #include "bufferobject.h"
85 #include "tupleobject.h"
86 #include "listobject.h"
87 #include "dictobject.h"
88 #include "enumobject.h"
89 #include "methodobject.h"
90 #include "moduleobject.h"
91 #include "funcobject.h"
92 #include "classobject.h"
93 #include "fileobject.h"
94 #include "cobject.h"
95 #include "traceback.h"
96 #include "sliceobject.h"
97 #include "cellobject.h"
98 #include "iterobject.h"
99 #include "descrobject.h"
100 #include "weakrefobject.h"
102 #include "codecs.h"
103 #include "pyerrors.h"
105 #include "pystate.h"
107 #include "modsupport.h"
108 #include "pythonrun.h"
109 #include "ceval.h"
110 #include "sysmodule.h"
111 #include "intrcheck.h"
112 #include "import.h"
114 #include "abstract.h"
116 /* _Py_Mangle is defined in compile.c */
117 PyAPI_FUNC(int) _Py_Mangle(char *p, char *name, \
118 char *buffer, size_t maxlen);
120 /* PyArg_GetInt is deprecated and should not be used, use PyArg_Parse(). */
121 #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
123 /* PyArg_NoArgs should not be necessary.
124 Set ml_flags in the PyMethodDef to METH_NOARGS. */
125 #define PyArg_NoArgs(v) PyArg_Parse(v, "")
127 /* Convert a possibly signed character to a nonnegative int */
128 /* XXX This assumes characters are 8 bits wide */
129 #ifdef __CHAR_UNSIGNED__
130 #define Py_CHARMASK(c) (c)
131 #else
132 #define Py_CHARMASK(c) ((c) & 0xff)
133 #endif
135 #include "pyfpe.h"
137 /* These definitions must match corresponding definitions in graminit.h.
138 There's code in compile.c that checks that they are the same. */
139 #define Py_single_input 256
140 #define Py_file_input 257
141 #define Py_eval_input 258
143 #ifdef HAVE_PTH
144 /* GNU pth user-space thread support */
145 #include <pth.h>
146 #endif
148 /* Define macros for inline documentation. */
149 #define PyDoc_VAR(name) static char name[]
150 #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
151 #ifdef WITH_DOC_STRINGS
152 #define PyDoc_STR(str) str
153 #else
154 #define PyDoc_STR(str) ""
155 #endif
157 #endif /* !Py_PYTHON_H */