blob: 153ba079786909b51ae51bb3793f263b8e4b7949 [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
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 Rossum43466ec1998-12-04 18:48:25 +000030#ifndef DL_EXPORT /* declarations for DLL import/export */
31#define DL_EXPORT(RTYPE) RTYPE
32#endif
Guido van Rossum174f95a1997-05-02 03:55:52 +000033
Guido van Rossum90ce8481998-05-26 18:38:07 +000034#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
35#define _SGI_MP_SOURCE
36#endif
37
Guido van Rossum174f95a1997-05-02 03:55:52 +000038#include <stdio.h>
Tim Peters4826a892000-09-10 01:02:41 +000039#ifndef NULL
40# error "Python.h requires that stdio.h define NULL."
41#endif
42
Guido van Rossum174f95a1997-05-02 03:55:52 +000043#include <string.h>
44#include <errno.h>
45#ifdef HAVE_STDLIB_H
46#include <stdlib.h>
47#endif
Tim Peters8315ea52000-07-23 19:28:35 +000048#include <assert.h>
49
50#include "pyport.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000051
Peter Schneider-Kamp25f68942000-07-31 22:19:30 +000052#include "pymem.h"
53
Guido van Rossum174f95a1997-05-02 03:55:52 +000054#include "object.h"
55#include "objimpl.h"
56
57#include "pydebug.h"
58
Guido van Rossum9e896b32000-04-05 20:11:21 +000059#include "unicodeobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000060#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 Rossum2e19bd71998-10-07 14:36:10 +000068#include "bufferobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000069#include "tupleobject.h"
70#include "listobject.h"
Guido van Rossum2ec90311997-05-13 21:23:32 +000071#include "dictobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000072#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 Rossumbd7dfbc2000-03-10 22:34:00 +000081#include "codecs.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000082#include "pyerrors.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000083
Guido van Rossum618af4b1997-07-18 23:59:26 +000084#include "pystate.h"
85
Guido van Rossum174f95a1997-05-02 03:55:52 +000086#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 Rossum174f95a1997-05-02 03:55:52 +000092
Guido van Rossum174f95a1997-05-02 03:55:52 +000093#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 Ward95811442000-05-28 20:29:48 +0000108/* These definitions must match corresponding definitions in graminit.h.
Guido van Rossumb05a5c71997-05-07 17:46:13 +0000109 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 Rossum9e8181b2000-09-19 00:46:46 +0000114#ifdef HAVE_PTH
Guido van Rossum07bd90e2000-05-08 13:41:38 +0000115/* GNU pth user-space thread support */
116#include <pth.h>
117#endif
Guido van Rossumd27b4f21997-05-02 04:00:11 +0000118#endif /* !Py_PYTHON_H */