blob: b36b5daeae017e56c00862dcb2ab0c250274adf6 [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"
Tim Peters7d3a5112000-07-08 04:17:21 +000034#include "pyport.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000035
36/* config.h may or may not define DL_IMPORT */
37#ifndef DL_IMPORT /* declarations for DLL import/export */
38#define DL_IMPORT(RTYPE) RTYPE
39#endif
Guido van Rossum43466ec1998-12-04 18:48:25 +000040#ifndef DL_EXPORT /* declarations for DLL import/export */
41#define DL_EXPORT(RTYPE) RTYPE
42#endif
Guido van Rossum174f95a1997-05-02 03:55:52 +000043
44#ifdef SYMANTEC__CFM68K__
45#define UsingSharedLibs
46#endif
47
Guido van Rossum90ce8481998-05-26 18:38:07 +000048#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
49#define _SGI_MP_SOURCE
50#endif
51
Guido van Rossum174f95a1997-05-02 03:55:52 +000052#include <stdio.h>
53#include <string.h>
54#include <errno.h>
55#ifdef HAVE_STDLIB_H
56#include <stdlib.h>
57#endif
58
59#include "myproto.h"
60
61#ifdef SYMANTEC__CFM68K__
62#pragma lib_export on
63#endif
64
65#include "object.h"
66#include "objimpl.h"
67
68#include "pydebug.h"
69
Guido van Rossum9e896b32000-04-05 20:11:21 +000070#include "unicodeobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000071#include "intobject.h"
72#include "longobject.h"
73#include "floatobject.h"
74#ifndef WITHOUT_COMPLEX
75#include "complexobject.h"
76#endif
77#include "rangeobject.h"
78#include "stringobject.h"
Guido van Rossum2e19bd71998-10-07 14:36:10 +000079#include "bufferobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000080#include "tupleobject.h"
81#include "listobject.h"
Guido van Rossum2ec90311997-05-13 21:23:32 +000082#include "dictobject.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000083#include "methodobject.h"
84#include "moduleobject.h"
85#include "funcobject.h"
86#include "classobject.h"
87#include "fileobject.h"
88#include "cobject.h"
89#include "traceback.h"
90#include "sliceobject.h"
91
Guido van Rossumbd7dfbc2000-03-10 22:34:00 +000092#include "codecs.h"
Guido van Rossum174f95a1997-05-02 03:55:52 +000093#include "pyerrors.h"
94#include "mymalloc.h"
95
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"
99#include "ceval.h"
100#include "pythonrun.h"
101#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 Rossum07bd90e2000-05-08 13:41:38 +0000126#ifdef _GNU_PTH
127/* 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 */