blob: 24d33b266dc061c2aab0ad73527aa32caae84b24 [file] [log] [blame]
Guido van Rossumd27b4f21997-05-02 04:00:11 +00001#ifndef Py_PYTHON_H
2#define Py_PYTHON_H
Guido van Rossum174f95a1997-05-02 03:55:52 +00003/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
4
Guido van Rossum174f95a1997-05-02 03:55:52 +00005
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +00006/* Enable compiler features; switching on C lib defines doesn't work
7 here, because the symbols haven't necessarily been defined yet. */
Marc-André Lemburg82249c82000-07-05 08:53:18 +00008#ifndef _GNU_SOURCE
9# define _GNU_SOURCE 1
10#endif
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +000011
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é Lemburg82249c82000-07-05 08:53:18 +000016#ifndef _XOPEN_SOURCE
17# define _XOPEN_SOURCE 500
18#endif
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +000019#endif
Marc-André Lemburg82249c82000-07-05 08:53:18 +000020
Guido van Rossum174f95a1997-05-02 03:55:52 +000021/* Include nearly all Python header files */
22
Guido van Rossumf1176c41999-01-03 12:40:24 +000023#include "patchlevel.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000024#include "config.h"
25
Fred Draked5fadf72000-09-26 05:46:01 +000026#ifdef HAVE_LIMITS_H
27#include <limits.h>
28#endif
29
Guido van Rossum174f95a1997-05-02 03:55:52 +000030/* config.h may or may not define DL_IMPORT */
31#ifndef DL_IMPORT /* declarations for DLL import/export */
32#define DL_IMPORT(RTYPE) RTYPE
33#endif
Guido van Rossum43466ec1998-12-04 18:48:25 +000034#ifndef DL_EXPORT /* declarations for DLL import/export */
35#define DL_EXPORT(RTYPE) RTYPE
36#endif
Guido van Rossum174f95a1997-05-02 03:55:52 +000037
Guido van Rossum90ce8481998-05-26 18:38:07 +000038#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
39#define _SGI_MP_SOURCE
40#endif
41
Guido van Rossum174f95a1997-05-02 03:55:52 +000042#include <stdio.h>
Tim Peters4826a892000-09-10 01:02:41 +000043#ifndef NULL
44# error "Python.h requires that stdio.h define NULL."
45#endif
46
Guido van Rossum174f95a1997-05-02 03:55:52 +000047#include <string.h>
48#include <errno.h>
49#ifdef HAVE_STDLIB_H
50#include <stdlib.h>
51#endif
Guido van Rossumb2c075b2001-07-15 16:58:05 +000052
53#ifndef Py_DEBUG
Tim Peters0d5dd682001-07-15 18:38:47 +000054#ifndef NDEBUG
Guido van Rossumb2c075b2001-07-15 16:58:05 +000055#define NDEBUG 1
56#endif
Tim Peters0d5dd682001-07-15 18:38:47 +000057#endif
Tim Peters8315ea52000-07-23 19:28:35 +000058#include <assert.h>
59
60#include "pyport.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000061
Peter Schneider-Kamp25f68942000-07-31 22:19:30 +000062#include "pymem.h"
63
Guido van Rossum174f95a1997-05-02 03:55:52 +000064#include "object.h"
65#include "objimpl.h"
66
67#include "pydebug.h"
68
Guido van Rossum9e896b32000-04-05 20:11:21 +000069#include "unicodeobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000070#include "intobject.h"
71#include "longobject.h"
72#include "floatobject.h"
73#ifndef WITHOUT_COMPLEX
74#include "complexobject.h"
75#endif
76#include "rangeobject.h"
77#include "stringobject.h"
Guido van Rossum2e19bd71998-10-07 14:36:10 +000078#include "bufferobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000079#include "tupleobject.h"
80#include "listobject.h"
Guido van Rossum2ec90311997-05-13 21:23:32 +000081#include "dictobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000082#include "methodobject.h"
83#include "moduleobject.h"
84#include "funcobject.h"
85#include "classobject.h"
86#include "fileobject.h"
87#include "cobject.h"
88#include "traceback.h"
89#include "sliceobject.h"
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000090#include "cellobject.h"
Guido van Rossum59d1d2b2001-04-20 19:13:02 +000091#include "iterobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000092
Guido van Rossumbd7dfbc2000-03-10 22:34:00 +000093#include "codecs.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000094#include "pyerrors.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000095
Guido van Rossum618af4b1997-07-18 23:59:26 +000096#include "pystate.h"
97
Guido van Rossum174f95a1997-05-02 03:55:52 +000098#include "modsupport.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000099#include "pythonrun.h"
Tim Peters5ba58662001-07-16 02:29:45 +0000100#include "ceval.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +0000101#include "sysmodule.h"
102#include "intrcheck.h"
103#include "import.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +0000104
Guido van Rossum174f95a1997-05-02 03:55:52 +0000105#include "abstract.h"
106
107#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
108#define PyArg_NoArgs(v) PyArg_Parse(v, "")
109
110/* Convert a possibly signed character to a nonnegative int */
111/* XXX This assumes characters are 8 bits wide */
112#ifdef __CHAR_UNSIGNED__
113#define Py_CHARMASK(c) (c)
114#else
115#define Py_CHARMASK(c) ((c) & 0xff)
116#endif
117
118#include "pyfpe.h"
119
Greg Ward95811442000-05-28 20:29:48 +0000120/* These definitions must match corresponding definitions in graminit.h.
Guido van Rossumb05a5c71997-05-07 17:46:13 +0000121 There's code in compile.c that checks that they are the same. */
122#define Py_single_input 256
123#define Py_file_input 257
124#define Py_eval_input 258
125
Guido van Rossum9e8181b2000-09-19 00:46:46 +0000126#ifdef HAVE_PTH
Guido van Rossum07bd90e2000-05-08 13:41:38 +0000127/* GNU pth user-space thread support */
128#include <pth.h>
129#endif
Guido van Rossumd27b4f21997-05-02 04:00:11 +0000130#endif /* !Py_PYTHON_H */