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" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 24 | #include "config.h" |
| 25 | |
| 26 | /* config.h may or may not define DL_IMPORT */ |
| 27 | #ifndef DL_IMPORT /* declarations for DLL import/export */ |
| 28 | #define DL_IMPORT(RTYPE) RTYPE |
| 29 | #endif |
Guido van Rossum | 43466ec | 1998-12-04 18:48:25 +0000 | [diff] [blame] | 30 | #ifndef DL_EXPORT /* declarations for DLL import/export */ |
| 31 | #define DL_EXPORT(RTYPE) RTYPE |
| 32 | #endif |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 33 | |
Guido van Rossum | 90ce848 | 1998-05-26 18:38:07 +0000 | [diff] [blame] | 34 | #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE) |
| 35 | #define _SGI_MP_SOURCE |
| 36 | #endif |
| 37 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 38 | #include <stdio.h> |
Tim Peters | 4826a89 | 2000-09-10 01:02:41 +0000 | [diff] [blame] | 39 | #ifndef NULL |
| 40 | # error "Python.h requires that stdio.h define NULL." |
| 41 | #endif |
| 42 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 43 | #include <string.h> |
| 44 | #include <errno.h> |
| 45 | #ifdef HAVE_STDLIB_H |
| 46 | #include <stdlib.h> |
| 47 | #endif |
Tim Peters | 8315ea5 | 2000-07-23 19:28:35 +0000 | [diff] [blame] | 48 | #include <assert.h> |
| 49 | |
| 50 | #include "pyport.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 51 | |
Peter Schneider-Kamp | 25f6894 | 2000-07-31 22:19:30 +0000 | [diff] [blame] | 52 | #include "pymem.h" |
| 53 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 54 | #include "object.h" |
| 55 | #include "objimpl.h" |
| 56 | |
| 57 | #include "pydebug.h" |
| 58 | |
Guido van Rossum | 9e896b3 | 2000-04-05 20:11:21 +0000 | [diff] [blame] | 59 | #include "unicodeobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 60 | #include "intobject.h" |
| 61 | #include "longobject.h" |
| 62 | #include "floatobject.h" |
| 63 | #ifndef WITHOUT_COMPLEX |
| 64 | #include "complexobject.h" |
| 65 | #endif |
| 66 | #include "rangeobject.h" |
| 67 | #include "stringobject.h" |
Guido van Rossum | 2e19bd7 | 1998-10-07 14:36:10 +0000 | [diff] [blame] | 68 | #include "bufferobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 69 | #include "tupleobject.h" |
| 70 | #include "listobject.h" |
Guido van Rossum | 2ec9031 | 1997-05-13 21:23:32 +0000 | [diff] [blame] | 71 | #include "dictobject.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 72 | #include "methodobject.h" |
| 73 | #include "moduleobject.h" |
| 74 | #include "funcobject.h" |
| 75 | #include "classobject.h" |
| 76 | #include "fileobject.h" |
| 77 | #include "cobject.h" |
| 78 | #include "traceback.h" |
| 79 | #include "sliceobject.h" |
| 80 | |
Guido van Rossum | bd7dfbc | 2000-03-10 22:34:00 +0000 | [diff] [blame] | 81 | #include "codecs.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 82 | #include "pyerrors.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 83 | |
Guido van Rossum | 618af4b | 1997-07-18 23:59:26 +0000 | [diff] [blame] | 84 | #include "pystate.h" |
| 85 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 86 | #include "modsupport.h" |
| 87 | #include "ceval.h" |
| 88 | #include "pythonrun.h" |
| 89 | #include "sysmodule.h" |
| 90 | #include "intrcheck.h" |
| 91 | #include "import.h" |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 92 | |
Guido van Rossum | 174f95a | 1997-05-02 03:55:52 +0000 | [diff] [blame] | 93 | #include "abstract.h" |
| 94 | |
| 95 | #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a)) |
| 96 | #define PyArg_NoArgs(v) PyArg_Parse(v, "") |
| 97 | |
| 98 | /* Convert a possibly signed character to a nonnegative int */ |
| 99 | /* XXX This assumes characters are 8 bits wide */ |
| 100 | #ifdef __CHAR_UNSIGNED__ |
| 101 | #define Py_CHARMASK(c) (c) |
| 102 | #else |
| 103 | #define Py_CHARMASK(c) ((c) & 0xff) |
| 104 | #endif |
| 105 | |
| 106 | #include "pyfpe.h" |
| 107 | |
Greg Ward | 9581144 | 2000-05-28 20:29:48 +0000 | [diff] [blame] | 108 | /* These definitions must match corresponding definitions in graminit.h. |
Guido van Rossum | b05a5c7 | 1997-05-07 17:46:13 +0000 | [diff] [blame] | 109 | There's code in compile.c that checks that they are the same. */ |
| 110 | #define Py_single_input 256 |
| 111 | #define Py_file_input 257 |
| 112 | #define Py_eval_input 258 |
| 113 | |
Guido van Rossum | 9e8181b | 2000-09-19 00:46:46 +0000 | [diff] [blame] | 114 | #ifdef HAVE_PTH |
Guido van Rossum | 07bd90e | 2000-05-08 13:41:38 +0000 | [diff] [blame] | 115 | /* GNU pth user-space thread support */ |
| 116 | #include <pth.h> |
| 117 | #endif |
Guido van Rossum | d27b4f2 | 1997-05-02 04:00:11 +0000 | [diff] [blame] | 118 | #endif /* !Py_PYTHON_H */ |