Python.h revision 9e896b37c7a554250d7d832566cc4fe7d30d034c
1d27b4f2a3f6a90dfcc5eb6fb30c1a895ed60142dGuido van Rossum#ifndef Py_PYTHON_H
2d27b4f2a3f6a90dfcc5eb6fb30c1a895ed60142dGuido van Rossum#define Py_PYTHON_H
3174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
4174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
5174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/***********************************************************
6174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumCopyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumThe Netherlands.
8174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
9174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum                        All Rights Reserved
10174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
11174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumPermission to use, copy, modify, and distribute this software and its
12174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumdocumentation for any purpose and without fee is hereby granted,
13174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumprovided that the above copyright notice appear in all copies and that
14174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumboth that copyright notice and this permission notice appear in
15174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumsupporting documentation, and that the names of Stichting Mathematisch
16174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumCentrum or CWI or Corporation for National Research Initiatives or
17174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumCNRI not be used in advertising or publicity pertaining to
18174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumdistribution of the software without specific, written prior
19174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumpermission.
20174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
21174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumWhile CWI is the initial source for this software, a modified version
22174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossumis made available by the Corporation for National Research Initiatives
23174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum(CNRI) at the Internet address ftp://ftp.python.org.
24174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
25174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumSTICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
26174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumREGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
27174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumMERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
28174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumCENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
29174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumDAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
30174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumPROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
31174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
32174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van RossumPERFORMANCE OF THIS SOFTWARE.
33174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
34174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum******************************************************************/
35174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
36174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/* Include nearly all Python header files */
37174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
38f1176c4815cd628ae443b5c4b0e1841588369776Guido van Rossum#include "patchlevel.h"
39174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "config.h"
40174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
41174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/* config.h may or may not define DL_IMPORT */
42174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifndef DL_IMPORT	/* declarations for DLL import/export */
43174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define DL_IMPORT(RTYPE) RTYPE
44174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
4543466ec7b07de6bcad016bec60839cd6079c5a9cGuido van Rossum#ifndef DL_EXPORT	/* declarations for DLL import/export */
4643466ec7b07de6bcad016bec60839cd6079c5a9cGuido van Rossum#define DL_EXPORT(RTYPE) RTYPE
4743466ec7b07de6bcad016bec60839cd6079c5a9cGuido van Rossum#endif
48174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
49174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifdef SYMANTEC__CFM68K__
50174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define UsingSharedLibs
51174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
52174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
5390ce8488481521e5ddd1fe5ed942e1df4acd6365Guido van Rossum#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
5490ce8488481521e5ddd1fe5ed942e1df4acd6365Guido van Rossum#define _SGI_MP_SOURCE
5590ce8488481521e5ddd1fe5ed942e1df4acd6365Guido van Rossum#endif
5690ce8488481521e5ddd1fe5ed942e1df4acd6365Guido van Rossum
57174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include <stdio.h>
58174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include <string.h>
59174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include <errno.h>
60174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifdef HAVE_STDLIB_H
61174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include <stdlib.h>
62174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
63174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
64174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "myproto.h"
65174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
66174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifdef SYMANTEC__CFM68K__
67174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#pragma lib_export on
68174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
69174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
70174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "object.h"
71174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "objimpl.h"
72174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
73174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "pydebug.h"
74174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
759e896b37c7a554250d7d832566cc4fe7d30d034cGuido van Rossum#include "unicodeobject.h"
76174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "intobject.h"
77174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "longobject.h"
78174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "floatobject.h"
79174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifndef WITHOUT_COMPLEX
80174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "complexobject.h"
81174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
82174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "rangeobject.h"
83174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "stringobject.h"
842e19bd7cc7520052b0c6e3d3da6baf45fb3b5e6bGuido van Rossum#include "bufferobject.h"
85174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "tupleobject.h"
86174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "listobject.h"
872ec9031b5589db81026f5fc3a11070002ec4d0d7Guido van Rossum#include "dictobject.h"
88174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "methodobject.h"
89174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "moduleobject.h"
90174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "funcobject.h"
91174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "classobject.h"
92174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "fileobject.h"
93174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "cobject.h"
94174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "traceback.h"
95174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "sliceobject.h"
96174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
97bd7dfbc146deb31c520d886415ffd2d00f6970b0Guido van Rossum#include "codecs.h"
98174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "pyerrors.h"
99174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "mymalloc.h"
100174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
101618af4b3ef08d5eee9c36fafd4cd57c54573f95eGuido van Rossum#include "pystate.h"
102618af4b3ef08d5eee9c36fafd4cd57c54573f95eGuido van Rossum
103174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "modsupport.h"
104174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "ceval.h"
105174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "pythonrun.h"
106174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "sysmodule.h"
107174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "intrcheck.h"
108174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "import.h"
109174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
110174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "abstract.h"
111174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
112174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define PyArg_GetInt(v, a)	PyArg_Parse((v), "i", (a))
113174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define PyArg_NoArgs(v)		PyArg_Parse(v, "")
114174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
115174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/* Convert a possibly signed character to a nonnegative int */
116174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum/* XXX This assumes characters are 8 bits wide */
117174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#ifdef __CHAR_UNSIGNED__
118174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define Py_CHARMASK(c)		(c)
119174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#else
120174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#define Py_CHARMASK(c)		((c) & 0xff)
121174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#endif
122174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
123174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum#include "pyfpe.h"
124174f95adf7ee1251738a291d0fb52760ea1b25c0Guido van Rossum
125b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum/* These definitions much match corresponding definitions in graminit.h.
126b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum   There's code in compile.c that checks that they are the same. */
127b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum#define Py_single_input 256
128b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum#define Py_file_input 257
129b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum#define Py_eval_input 258
130b05a5c7698cd8dff3e5c02e513db765ba12281f0Guido van Rossum
131d27b4f2a3f6a90dfcc5eb6fb30c1a895ed60142dGuido van Rossum#endif /* !Py_PYTHON_H */
132