blob: 3389c0a41d8adca33e8b7aab916faeffcc08cd41 [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
5/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00006Copyright (c) 2000, BeOpen.com.
7Copyright (c) 1995-2000, Corporation for National Research Initiatives.
8Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
9All rights reserved.
Guido van Rossum174f95a1997-05-02 03:55:52 +000010
Guido van Rossumfd71b9e2000-06-30 23:50:40 +000011See the file "Misc/COPYRIGHT" for information on usage and
12redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum174f95a1997-05-02 03:55:52 +000013******************************************************************/
14
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +000015/* Enable compiler features; switching on C lib defines doesn't work
16 here, because the symbols haven't necessarily been defined yet. */
Marc-André Lemburg82249c82000-07-05 08:53:18 +000017#ifndef _GNU_SOURCE
18# define _GNU_SOURCE 1
19#endif
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +000020
21/* Forcing SUSv2 compatibility still produces problems on some
22 platforms, True64 and SGI IRIX begin two of them, so for now the
23 define is switched off. */
24#if 0
Marc-André Lemburg82249c82000-07-05 08:53:18 +000025#ifndef _XOPEN_SOURCE
26# define _XOPEN_SOURCE 500
27#endif
Marc-André Lemburg295b1bb2000-07-07 11:24:49 +000028#endif
Marc-André Lemburg82249c82000-07-05 08:53:18 +000029
Guido van Rossum174f95a1997-05-02 03:55:52 +000030/* Include nearly all Python header files */
31
Guido van Rossumf1176c41999-01-03 12:40:24 +000032#include "patchlevel.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000033#include "config.h"
34
35/* config.h may or may not define DL_IMPORT */
36#ifndef DL_IMPORT /* declarations for DLL import/export */
37#define DL_IMPORT(RTYPE) RTYPE
38#endif
Guido van Rossum43466ec1998-12-04 18:48:25 +000039#ifndef DL_EXPORT /* declarations for DLL import/export */
40#define DL_EXPORT(RTYPE) RTYPE
41#endif
Guido van Rossum174f95a1997-05-02 03:55:52 +000042
43#ifdef SYMANTEC__CFM68K__
44#define UsingSharedLibs
45#endif
46
Guido van Rossum90ce8481998-05-26 18:38:07 +000047#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
48#define _SGI_MP_SOURCE
49#endif
50
Guido van Rossum174f95a1997-05-02 03:55:52 +000051#include <stdio.h>
52#include <string.h>
53#include <errno.h>
54#ifdef HAVE_STDLIB_H
55#include <stdlib.h>
56#endif
57
58#include "myproto.h"
59
60#ifdef SYMANTEC__CFM68K__
61#pragma lib_export on
62#endif
63
64#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"
90
Guido van Rossumbd7dfbc2000-03-10 22:34:00 +000091#include "codecs.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000092#include "pyerrors.h"
93#include "mymalloc.h"
94
Guido van Rossum618af4b1997-07-18 23:59:26 +000095#include "pystate.h"
96
Guido van Rossum174f95a1997-05-02 03:55:52 +000097#include "modsupport.h"
98#include "ceval.h"
99#include "pythonrun.h"
100#include "sysmodule.h"
101#include "intrcheck.h"
102#include "import.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +0000103
Guido van Rossum174f95a1997-05-02 03:55:52 +0000104#include "abstract.h"
105
106#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
107#define PyArg_NoArgs(v) PyArg_Parse(v, "")
108
109/* Convert a possibly signed character to a nonnegative int */
110/* XXX This assumes characters are 8 bits wide */
111#ifdef __CHAR_UNSIGNED__
112#define Py_CHARMASK(c) (c)
113#else
114#define Py_CHARMASK(c) ((c) & 0xff)
115#endif
116
117#include "pyfpe.h"
118
Greg Ward95811442000-05-28 20:29:48 +0000119/* These definitions must match corresponding definitions in graminit.h.
Guido van Rossumb05a5c71997-05-07 17:46:13 +0000120 There's code in compile.c that checks that they are the same. */
121#define Py_single_input 256
122#define Py_file_input 257
123#define Py_eval_input 258
124
Guido van Rossum07bd90e2000-05-08 13:41:38 +0000125#ifdef _GNU_PTH
126/* GNU pth user-space thread support */
127#include <pth.h>
128#endif
Guido van Rossumd27b4f21997-05-02 04:00:11 +0000129#endif /* !Py_PYTHON_H */