annotate Include/Python.h @ 13776:33df3b516711 legacy-trunk

patch from Vladimir (move Py_Mem* interface to Include/pymem.h)
author Peter Schneider-Kamp <nowonder@nowonder.de>
date Mon, 31 Jul 2000 22:19:30 +0000
parents 59f8cedcf049
children 6f6f965c5e2d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5398
72b231edfb25 Several oopsies -- Py_ALLOBJECTS_H -> Py_PYTHON_H, temporarily removed
Guido van Rossum <guido@python.org>
parents: 5397
diff changeset
1 #ifndef Py_PYTHON_H
72b231edfb25 Several oopsies -- Py_ALLOBJECTS_H -> Py_PYTHON_H, temporarily removed
Guido van Rossum <guido@python.org>
parents: 5397
diff changeset
2 #define Py_PYTHON_H
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
3 /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
4
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
5 /***********************************************************
13255
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
6 Copyright (c) 2000, BeOpen.com.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
7 Copyright (c) 1995-2000, Corporation for National Research Initiatives.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
8 Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
9 All rights reserved.
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
10
13255
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
11 See the file "Misc/COPYRIGHT" for information on usage and
916fb024ce94 Change copyright notice.
Guido van Rossum <guido@python.org>
parents: 12784
diff changeset
12 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
13 ******************************************************************/
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
14
13395
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
15 /* Enable compiler features; switching on C lib defines doesn't work
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
16 here, because the symbols haven't necessarily been defined yet. */
13351
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
17 #ifndef _GNU_SOURCE
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
18 # define _GNU_SOURCE 1
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
19 #endif
13395
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
20
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
21 /* Forcing SUSv2 compatibility still produces problems on some
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
22 platforms, True64 and SGI IRIX begin two of them, so for now the
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
23 define is switched off. */
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
24 #if 0
13351
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
25 #ifndef _XOPEN_SOURCE
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
26 # define _XOPEN_SOURCE 500
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
27 #endif
13395
317e8e09ce87 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Marc-André Lemburg <mal@egenix.com>
parents: 13351
diff changeset
28 #endif
13351
5619c3f7a44b Added #defines to enable SUSv2 compatibility where available and
Marc-André Lemburg <mal@egenix.com>
parents: 13256
diff changeset
29
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
30 /* Include nearly all Python header files */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
31
9744
85ab28644201 New version identification scheme.
Guido van Rossum <guido@python.org>
parents: 9586
diff changeset
32 #include "patchlevel.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
33 #include "config.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
34
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
35 /* config.h may or may not define DL_IMPORT */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
36 #ifndef DL_IMPORT /* declarations for DLL import/export */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
37 #define DL_IMPORT(RTYPE) RTYPE
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
38 #endif
9586
60fdb1db1175 Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents: 9278
diff changeset
39 #ifndef DL_EXPORT /* declarations for DLL import/export */
60fdb1db1175 Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents: 9278
diff changeset
40 #define DL_EXPORT(RTYPE) RTYPE
60fdb1db1175 Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents: 9278
diff changeset
41 #endif
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
42
8429
f7c58ed2981d On SGI, we need to define _SGI_MP_SOURCE before including errno.h when
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
43 #if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
f7c58ed2981d On SGI, we need to define _SGI_MP_SOURCE before including errno.h when
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
44 #define _SGI_MP_SOURCE
f7c58ed2981d On SGI, we need to define _SGI_MP_SOURCE before including errno.h when
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
45 #endif
f7c58ed2981d On SGI, we need to define _SGI_MP_SOURCE before including errno.h when
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
46
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
47 #include <stdio.h>
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
48 #include <string.h>
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
49 #include <errno.h>
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
50 #ifdef HAVE_STDLIB_H
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
51 #include <stdlib.h>
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
52 #endif
13674
c90d94d287d7 Included assert.h in Python.h -- it's absurd that this basic tool of
Tim Peters <tim.peters@gmail.com>
parents: 13579
diff changeset
53 #include <assert.h>
c90d94d287d7 Included assert.h in Python.h -- it's absurd that this basic tool of
Tim Peters <tim.peters@gmail.com>
parents: 13579
diff changeset
54
c90d94d287d7 Included assert.h in Python.h -- it's absurd that this basic tool of
Tim Peters <tim.peters@gmail.com>
parents: 13579
diff changeset
55 #include "pyport.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
56
13776
33df3b516711 patch from Vladimir (move Py_Mem* interface to Include/pymem.h)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 13761
diff changeset
57 #include "pymem.h"
33df3b516711 patch from Vladimir (move Py_Mem* interface to Include/pymem.h)
Peter Schneider-Kamp <nowonder@nowonder.de>
parents: 13761
diff changeset
58
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
59 #include "object.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
60 #include "objimpl.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
61
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
62 #include "pydebug.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
63
12248
70154e2e9c89 Marc-Andre's third try at this bulk patch seems to work (except that
Guido van Rossum <guido@python.org>
parents: 11964
diff changeset
64 #include "unicodeobject.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
65 #include "intobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
66 #include "longobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
67 #include "floatobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
68 #ifndef WITHOUT_COMPLEX
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
69 #include "complexobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
70 #endif
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
71 #include "rangeobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
72 #include "stringobject.h"
9278
c39218a68df1 Add Greg Stein's buffer object API.
Guido van Rossum <guido@python.org>
parents: 8429
diff changeset
73 #include "bufferobject.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
74 #include "tupleobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
75 #include "listobject.h"
5508
3643f19d5ca1 Subsumed mappingobject.h in dictobject.h.
Guido van Rossum <guido@python.org>
parents: 5438
diff changeset
76 #include "dictobject.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
77 #include "methodobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
78 #include "moduleobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
79 #include "funcobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
80 #include "classobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
81 #include "fileobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
82 #include "cobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
83 #include "traceback.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
84 #include "sliceobject.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
85
11964
4412c7a32497 Marc-Andre Lemburg: include unicodeobject.h and codecs.h
Guido van Rossum <guido@python.org>
parents: 9744
diff changeset
86 #include "codecs.h"
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
87 #include "pyerrors.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
88
5848
f64a5f750696 Include pystate.h earlier so it can be referenced by ceval.h.
Guido van Rossum <guido@python.org>
parents: 5508
diff changeset
89 #include "pystate.h"
f64a5f750696 Include pystate.h earlier so it can be referenced by ceval.h.
Guido van Rossum <guido@python.org>
parents: 5508
diff changeset
90
5397
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
91 #include "modsupport.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
92 #include "ceval.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
93 #include "pythonrun.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
94 #include "sysmodule.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
95 #include "intrcheck.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
96 #include "import.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
97
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
98 #include "abstract.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
99
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
100 #define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
101 #define PyArg_NoArgs(v) PyArg_Parse(v, "")
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
102
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
103 /* Convert a possibly signed character to a nonnegative int */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
104 /* XXX This assumes characters are 8 bits wide */
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
105 #ifdef __CHAR_UNSIGNED__
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
106 #define Py_CHARMASK(c) (c)
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
107 #else
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
108 #define Py_CHARMASK(c) ((c) & 0xff)
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
109 #endif
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
110
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
111 #include "pyfpe.h"
fd7eb058ce5d Moved allobjects.h to Python.h (without rename2.h).
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
112
12784
5398b18f8319 Typo fix in comment.
Greg Ward <gward@python.net>
parents: 12611
diff changeset
113 /* These definitions must match corresponding definitions in graminit.h.
5438
e926c331ebbf Instead of importing graminit.h whenever one of the three grammar 'root'
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
114 There's code in compile.c that checks that they are the same. */
e926c331ebbf Instead of importing graminit.h whenever one of the three grammar 'root'
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
115 #define Py_single_input 256
e926c331ebbf Instead of importing graminit.h whenever one of the three grammar 'root'
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
116 #define Py_file_input 257
e926c331ebbf Instead of importing graminit.h whenever one of the three grammar 'root'
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
117 #define Py_eval_input 258
e926c331ebbf Instead of importing graminit.h whenever one of the three grammar 'root'
Guido van Rossum <guido@python.org>
parents: 5405
diff changeset
118
12611
b320cf3a98b9 Andy Dustman: add GNU pth user-space thread support.
Guido van Rossum <guido@python.org>
parents: 12248
diff changeset
119 #ifdef _GNU_PTH
b320cf3a98b9 Andy Dustman: add GNU pth user-space thread support.
Guido van Rossum <guido@python.org>
parents: 12248
diff changeset
120 /* GNU pth user-space thread support */
b320cf3a98b9 Andy Dustman: add GNU pth user-space thread support.
Guido van Rossum <guido@python.org>
parents: 12248
diff changeset
121 #include <pth.h>
b320cf3a98b9 Andy Dustman: add GNU pth user-space thread support.
Guido van Rossum <guido@python.org>
parents: 12248
diff changeset
122 #endif
5398
72b231edfb25 Several oopsies -- Py_ALLOBJECTS_H -> Py_PYTHON_H, temporarily removed
Guido van Rossum <guido@python.org>
parents: 5397
diff changeset
123 #endif /* !Py_PYTHON_H */