blob: 23938720049f61c4bca1c8eda969feff5ac0b279 [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
Tim Peters8315ea52000-07-23 19:28:35 +000052#include <assert.h>
53
54#include "pyport.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000055
Peter Schneider-Kamp25f68942000-07-31 22:19:30 +000056#include "pymem.h"
57
Guido van Rossum174f95a1997-05-02 03:55:52 +000058#include "object.h"
59#include "objimpl.h"
60
61#include "pydebug.h"
62
Guido van Rossum9e896b32000-04-05 20:11:21 +000063#include "unicodeobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000064#include "intobject.h"
65#include "longobject.h"
66#include "floatobject.h"
67#ifndef WITHOUT_COMPLEX
68#include "complexobject.h"
69#endif
70#include "rangeobject.h"
71#include "stringobject.h"
Guido van Rossum2e19bd71998-10-07 14:36:10 +000072#include "bufferobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000073#include "tupleobject.h"
74#include "listobject.h"
Guido van Rossum2ec90311997-05-13 21:23:32 +000075#include "dictobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000076#include "methodobject.h"
77#include "moduleobject.h"
78#include "funcobject.h"
79#include "classobject.h"
80#include "fileobject.h"
81#include "cobject.h"
82#include "traceback.h"
83#include "sliceobject.h"
Jeremy Hyltonfbd849f2001-01-25 20:04:14 +000084#include "cellobject.h"
Guido van Rossum59d1d2b2001-04-20 19:13:02 +000085#include "iterobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000086
Guido van Rossumbd7dfbc2000-03-10 22:34:00 +000087#include "codecs.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000088#include "pyerrors.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000089
Guido van Rossum618af4b1997-07-18 23:59:26 +000090#include "pystate.h"
91
Guido van Rossum174f95a1997-05-02 03:55:52 +000092#include "modsupport.h"
93#include "ceval.h"
94#include "pythonrun.h"
95#include "sysmodule.h"
96#include "intrcheck.h"
97#include "import.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000098
Guido van Rossum174f95a1997-05-02 03:55:52 +000099#include "abstract.h"
100
101#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
102#define PyArg_NoArgs(v) PyArg_Parse(v, "")
103
104/* Convert a possibly signed character to a nonnegative int */
105/* XXX This assumes characters are 8 bits wide */
106#ifdef __CHAR_UNSIGNED__
107#define Py_CHARMASK(c) (c)
108#else
109#define Py_CHARMASK(c) ((c) & 0xff)
110#endif
111
112#include "pyfpe.h"
113
Greg Ward95811442000-05-28 20:29:48 +0000114/* These definitions must match corresponding definitions in graminit.h.
Guido van Rossumb05a5c71997-05-07 17:46:13 +0000115 There's code in compile.c that checks that they are the same. */
116#define Py_single_input 256
117#define Py_file_input 257
118#define Py_eval_input 258
119
Guido van Rossum9e8181b2000-09-19 00:46:46 +0000120#ifdef HAVE_PTH
Guido van Rossum07bd90e2000-05-08 13:41:38 +0000121/* GNU pth user-space thread support */
122#include <pth.h>
123#endif
Guido van Rossumd27b4f21997-05-02 04:00:11 +0000124#endif /* !Py_PYTHON_H */