Guido van Rossum | d27b4f2 | 1997-05-02 04:00:11 +0000 | [diff] [blame] | 1 | #ifndef Py_PYTHON_H |
| 2 | #define Py_PYTHON_H |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 3 | /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ |
| 4 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 5 | |
Marc-André Lemburg | 295b1bb | 2000-07-07 11:24:49 +0000 | [diff] [blame] | 6 | /* Enable compiler features; switching on C lib defines doesn't work |
| 7 | here, because the symbols haven't necessarily been defined yet. */ |
Marc-André Lemburg | 82249c8 | 2000-07-05 08:53:18 +0000 | [diff] [blame] | 8 | #ifndef _GNU_SOURCE |
| 9 | # define _GNU_SOURCE 1 |
| 10 | #endif |
Marc-André Lemburg | 295b1bb | 2000-07-07 11:24:49 +0000 | [diff] [blame] | 11 | |
| 12 | /* Forcing SUSv2 compatibility still produces problems on some |
| 13 | platforms, True64 and SGI IRIX begin two of them, so for now the |
| 14 | define is switched off. */ |
| 15 | #if 0 |
Marc-André Lemburg | 82249c8 | 2000-07-05 08:53:18 +0000 | [diff] [blame] | 16 | #ifndef _XOPEN_SOURCE |
| 17 | # define _XOPEN_SOURCE 500 |
| 18 | #endif |
Marc-André Lemburg | 295b1bb | 2000-07-07 11:24:49 +0000 | [diff] [blame] | 19 | #endif |
Marc-André Lemburg | 82249c8 | 2000-07-05 08:53:18 +0000 | [diff] [blame] | 20 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 21 | /* Include nearly all Python header files */ |
| 22 | |
Guido van Rossum | f1176c4 | 1999-01-03 12:40:24 +0000 | [diff] [blame] | 23 | #include "patchlevel.h" |
Martin v. Löwis | 4f1cd8b | 2001-07-26 13:41:06 +0000 | [diff] [blame] | 24 | #include "pyconfig.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 25 | |
Fred Drake | d5fadf7 | 2000-09-26 05:46:01 +0000 | [diff] [blame] | 26 | #ifdef HAVE_LIMITS_H |
| 27 | #include <limits.h> |
| 28 | #endif |
| 29 | |
Tim Peters | 76f373d | 2001-07-26 21:34:59 +0000 | [diff] [blame] | 30 | /* pyconfig.h may or may not define DL_IMPORT */ |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 31 | #ifndef DL_IMPORT /* declarations for DLL import/export */ |
| 32 | #define DL_IMPORT(RTYPE) RTYPE |
| 33 | #endif |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 34 | #ifndef DL_EXPORT /* declarations for DLL import/export */ |
| 35 | #define DL_EXPORT(RTYPE) RTYPE |
| 36 | #endif |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 37 | |
Guido van Rossum | 90ce848 | 1998-05-26 18:38:07 +0000 | [diff] [blame] | 38 | #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) |
| 39 | #define _SGI_MP_SOURCE |
| 40 | #endif |
| 41 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 42 | #include <stdio.h> |
Tim Peters | 4826a89 | 2000-09-10 01:02:41 +0000 | [diff] [blame] | 43 | #ifndef NULL |
| 44 | # error "Python.h requires that stdio.h define NULL." |
| 45 | #endif |
| 46 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 47 | #include <string.h> |
| 48 | #include <errno.h> |
| 49 | #ifdef HAVE_STDLIB_H |
| 50 | #include <stdlib.h> |
| 51 | #endif |
Guido van Rossum | b2c075b | 2001-07-15 16:58:05 +0000 | [diff] [blame] | 52 | |
Tim Peters | 5defb17 | 2001-12-04 20:06:11 +0000 | [diff] [blame] | 53 | /* CAUTION: Build setups should ensure that NDEBUG is defined on the |
| 54 | * compiler command line when building Python in release mode; else |
| 55 | * assert() calls won't be removed. |
| 56 | */ |
Tim Peters | 8315ea5 | 2000-07-23 19:28:35 +0000 | [diff] [blame] | 57 | #include <assert.h> |
| 58 | |
| 59 | #include "pyport.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 60 | |
Peter Schneider-Kamp | 25f6894 | 2000-07-31 22:19:30 +0000 | [diff] [blame] | 61 | #include "pymem.h" |
| 62 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 63 | #include "object.h" |
| 64 | #include "objimpl.h" |
| 65 | |
| 66 | #include "pydebug.h" |
| 67 | |
Guido van Rossum | 9e896b3 | 2000-04-05 20:11:21 +0000 | [diff] [blame] | 68 | #include "unicodeobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 69 | #include "intobject.h" |
| 70 | #include "longobject.h" |
| 71 | #include "floatobject.h" |
| 72 | #ifndef WITHOUT_COMPLEX |
| 73 | #include "complexobject.h" |
| 74 | #endif |
| 75 | #include "rangeobject.h" |
| 76 | #include "stringobject.h" |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 77 | #include "bufferobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 78 | #include "tupleobject.h" |
| 79 | #include "listobject.h" |
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 80 | #include "dictobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 81 | #include "methodobject.h" |
| 82 | #include "moduleobject.h" |
| 83 | #include "funcobject.h" |
| 84 | #include "classobject.h" |
| 85 | #include "fileobject.h" |
| 86 | #include "cobject.h" |
| 87 | #include "traceback.h" |
| 88 | #include "sliceobject.h" |
Jeremy Hylton | fbd849f | 2001-01-25 20:04:14 +0000 | [diff] [blame] | 89 | #include "cellobject.h" |
Guido van Rossum | 59d1d2b | 2001-04-20 19:13:02 +0000 | [diff] [blame] | 90 | #include "iterobject.h" |
Tim Peters | 6d6c1a3 | 2001-08-02 04:15:00 +0000 | [diff] [blame] | 91 | #include "descrobject.h" |
Fred Drake | 19bc578 | 2001-10-05 21:55:19 +0000 | [diff] [blame] | 92 | #include "weakrefobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 93 | |
Guido van Rossum | bd7dfbc | 2000-03-10 22:34:00 +0000 | [diff] [blame] | 94 | #include "codecs.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 95 | #include "pyerrors.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 96 | |
Guido van Rossum | 618af4b | 1997-07-18 23:59:26 +0000 | [diff] [blame] | 97 | #include "pystate.h" |
| 98 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 99 | #include "modsupport.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 100 | #include "pythonrun.h" |
Tim Peters | 5ba5866 | 2001-07-16 02:29:45 +0000 | [diff] [blame] | 101 | #include "ceval.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 102 | #include "sysmodule.h" |
| 103 | #include "intrcheck.h" |
| 104 | #include "import.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 105 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 106 | #include "abstract.h" |
| 107 | |
| 108 | #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) |
| 109 | #define PyArg_NoArgs(v) PyArg_Parse(v, "") |
| 110 | |
| 111 | /* Convert a possibly signed character to a nonnegative int */ |
| 112 | /* XXX This assumes characters are 8 bits wide */ |
| 113 | #ifdef __CHAR_UNSIGNED__ |
| 114 | #define Py_CHARMASK(c) (c) |
| 115 | #else |
| 116 | #define Py_CHARMASK(c) ((c) & 0xff) |
| 117 | #endif |
| 118 | |
| 119 | #include "pyfpe.h" |
| 120 | |
Greg Ward | 9581144 | 2000-05-28 20:29:48 +0000 | [diff] [blame] | 121 | /* These definitions must match corresponding definitions in graminit.h. |
Guido van Rossum | b05a5c7 | 1997-05-07 17:46:13 +0000 | [diff] [blame] | 122 | There's code in compile.c that checks that they are the same. */ |
| 123 | #define Py_single_input 256 |
| 124 | #define Py_file_input 257 |
| 125 | #define Py_eval_input 258 |
| 126 | |
Guido van Rossum | 9e8181b | 2000-09-19 00:46:46 +0000 | [diff] [blame] | 127 | #ifdef HAVE_PTH |
Guido van Rossum | 07bd90e | 2000-05-08 13:41:38 +0000 | [diff] [blame] | 128 | /* GNU pth user-space thread support */ |
| 129 | #include <pth.h> |
| 130 | #endif |
Guido van Rossum | d27b4f2 | 1997-05-02 04:00:11 +0000 | [diff] [blame] | 131 | #endif /* !Py_PYTHON_H */ |