Mercurial > cpython-lru_cache-weakref
annotate Include/pythonrun.h @ 75100:6b7704fe1be1 2.6
- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
environment variable, to provide an opt-in way to protect against denial of
service attacks due to hash collisions within the dict and set types. Patch
by David Malcolm, based on work by Victor Stinner.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Mon, 20 Feb 2012 20:42:21 -0500 |
| parents | e38335d4df91 |
| children | 76d72e92fdea a0f43f4481e0 |
| rev | line source |
|---|---|
| 145 | 1 |
| 86 | 2 /* Interfaces to parse and execute pieces of python code */ |
| 3 | |
|
13445
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
4 #ifndef Py_PYTHONRUN_H |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
5 #define Py_PYTHONRUN_H |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
6 #ifdef __cplusplus |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
7 extern "C" { |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
8 #endif |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
9 |
|
37418
cea54c9d921d
Don't abbreviate ABS, use long name ABSOLUTE.
Neal Norwitz <nnorwitz@gmail.com>
parents:
36768
diff
changeset
|
10 #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ |
|
46118
c78d3586c474
Patch #2477: Added from __future__ import unicode_literals
Christian Heimes <christian@cheimes.de>
parents:
46107
diff
changeset
|
11 CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ |
|
c78d3586c474
Patch #2477: Added from __future__ import unicode_literals
Christian Heimes <christian@cheimes.de>
parents:
46107
diff
changeset
|
12 CO_FUTURE_UNICODE_LITERALS) |
|
36654
6b42920accc9
Per discussion on python-dev, remove CO_GENERATOR_ALLOWED. Leave comment about not removing yet.
Neal Norwitz <nnorwitz@gmail.com>
parents:
36207
diff
changeset
|
13 #define PyCF_MASK_OBSOLETE (CO_NESTED) |
|
27781
cc01fb654ce3
patch #683515: "Add unicode support to compile(), eval() and exec"
Just van Rossum <just@letterror.com>
parents:
27001
diff
changeset
|
14 #define PyCF_SOURCE_IS_UTF8 0x0100 |
|
27878
be7683a6f521
- Finally fixed the bug in compile() and exec where a string ending
Guido van Rossum <guido@python.org>
parents:
27781
diff
changeset
|
15 #define PyCF_DONT_IMPLY_DEDENT 0x0200 |
|
36660
3c0b26113df6
Generate code to recursively copy an AST into
Martin v. Löwis <martin@v.loewis.de>
parents:
36654
diff
changeset
|
16 #define PyCF_ONLY_AST 0x0400 |
|
19350
5b6a6d7d44ae
ceval, PyEval_MergeCompilerFlags: wasn't merging in the
Tim Peters <tim.peters@gmail.com>
parents:
19157
diff
changeset
|
17 |
|
16916
b0456d3a0f1f
Useful future statement support for the interactive interpreter
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
16421
diff
changeset
|
18 typedef struct { |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
19 int cf_flags; /* bitmask of CO_xxx flags relevant to future */ |
|
16916
b0456d3a0f1f
Useful future statement support for the interactive interpreter
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
16421
diff
changeset
|
20 } PyCompilerFlags; |
|
b0456d3a0f1f
Useful future statement support for the interactive interpreter
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
16421
diff
changeset
|
21 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
22 PyAPI_FUNC(void) Py_SetProgramName(char *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
23 PyAPI_FUNC(char *) Py_GetProgramName(void); |
|
7208
ce271e5f9bc5
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents:
6192
diff
changeset
|
24 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
25 PyAPI_FUNC(void) Py_SetPythonHome(char *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
26 PyAPI_FUNC(char *) Py_GetPythonHome(void); |
| 86 | 27 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
28 PyAPI_FUNC(void) Py_Initialize(void); |
|
33189
de804edf8bcd
Patch #900727: Add Py_InitializeEx to allow embedding without signals.
Martin v. Löwis <martin@v.loewis.de>
parents:
33070
diff
changeset
|
29 PyAPI_FUNC(void) Py_InitializeEx(int); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
30 PyAPI_FUNC(void) Py_Finalize(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
31 PyAPI_FUNC(int) Py_IsInitialized(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
32 PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
33 PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); |
|
13445
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
34 |
|
36768
d6c30ce3868b
Reconst parameters that lost their const in the AST merge.
Martin v. Löwis <martin@v.loewis.de>
parents:
36726
diff
changeset
|
35 PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); |
|
d6c30ce3868b
Reconst parameters that lost their const in the AST merge.
Martin v. Löwis <martin@v.loewis.de>
parents:
36726
diff
changeset
|
36 PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *); |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
37 PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
38 PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *); |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
39 PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *); |
|
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
40 PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *); |
| 86 | 41 |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
42 PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(const char *, const char *, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
43 int, PyCompilerFlags *flags, |
|
36065
ea083efdc96c
Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,
Neal Norwitz <nnorwitz@gmail.com>
parents:
35776
diff
changeset
|
44 PyArena *); |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
45 PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(FILE *, const char *, int, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
46 char *, char *, |
|
36065
ea083efdc96c
Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,
Neal Norwitz <nnorwitz@gmail.com>
parents:
35776
diff
changeset
|
47 PyCompilerFlags *, int *, |
|
ea083efdc96c
Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,
Neal Norwitz <nnorwitz@gmail.com>
parents:
35776
diff
changeset
|
48 PyArena *); |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
49 #define PyParser_SimpleParseString(S, B) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
50 PyParser_SimpleParseStringFlags(S, B, 0) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
51 #define PyParser_SimpleParseFile(FP, S, B) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
52 PyParser_SimpleParseFileFlags(FP, S, B, 0) |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
53 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
54 int); |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
55 PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
56 int, int); |
| 86 | 57 |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
58 PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
59 PyObject *, PyCompilerFlags *); |
| 86 | 60 |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
61 PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
62 PyObject *, PyObject *, int, |
|
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
63 PyCompilerFlags *); |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
64 |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
65 #define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL) |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
66 PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int, |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
67 PyCompilerFlags *); |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
68 PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int); |
|
1263
65a1e4e9cd54
* Fixed some subtleties with fastlocals. You can no longer access
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
69 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
70 PyAPI_FUNC(void) PyErr_Print(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
71 PyAPI_FUNC(void) PyErr_PrintEx(int); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
72 PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); |
| 86 | 73 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
74 PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); |
|
1868
63ad28939781
pythgonrun.h: added Py_AtExit().
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
75 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
76 PyAPI_FUNC(void) Py_Exit(int); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
77 |
|
26601
cc05c2c8660e
Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents:
25924
diff
changeset
|
78 PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); |
|
5111
21b871325c85
Added decl for Py_FdIsInteractive.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
79 |
|
24471
f66b3a3509c7
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents:
24420
diff
changeset
|
80 /* Bootstrap */ |
|
f66b3a3509c7
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents:
24420
diff
changeset
|
81 PyAPI_FUNC(int) Py_Main(int argc, char **argv); |
|
f66b3a3509c7
Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents:
24420
diff
changeset
|
82 |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
83 /* Use macros for a bunch of old variants */ |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
84 #define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
85 #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
86 #define PyRun_AnyFileEx(fp, name, closeit) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
87 PyRun_AnyFileExFlags(fp, name, closeit, NULL) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
88 #define PyRun_AnyFileFlags(fp, name, flags) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
89 PyRun_AnyFileExFlags(fp, name, 0, flags) |
|
35776
893be94c8891
Correct error to PyRun_SimpleString macro introduced in AST merge.
Mark Hammond <mhammond@skippinet.com.au>
parents:
35742
diff
changeset
|
90 #define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
91 #define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
92 #define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
93 #define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
94 #define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL) |
|
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
95 #define PyRun_File(fp, p, s, g, l) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
96 PyRun_FileExFlags(fp, p, s, g, l, 0, NULL) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
97 #define PyRun_FileEx(fp, p, s, g, l, c) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
98 PyRun_FileExFlags(fp, p, s, g, l, c, NULL) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
99 #define PyRun_FileFlags(fp, p, s, g, l, flags) \ |
|
61465
e38335d4df91
Recorded merge of revisions 81029 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47666
diff
changeset
|
100 PyRun_FileExFlags(fp, p, s, g, l, 0, flags) |
|
35742
1c4d192f1568
Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35297
diff
changeset
|
101 |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
102 /* In getpath.c */ |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
103 PyAPI_FUNC(char *) Py_GetProgramFullPath(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
104 PyAPI_FUNC(char *) Py_GetPrefix(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
105 PyAPI_FUNC(char *) Py_GetExecPrefix(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
106 PyAPI_FUNC(char *) Py_GetPath(void); |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
107 |
|
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
108 /* In their own files */ |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
109 PyAPI_FUNC(const char *) Py_GetVersion(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
110 PyAPI_FUNC(const char *) Py_GetPlatform(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
111 PyAPI_FUNC(const char *) Py_GetCopyright(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
112 PyAPI_FUNC(const char *) Py_GetCompiler(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
113 PyAPI_FUNC(const char *) Py_GetBuildInfo(void); |
|
36207
825a041813fb
Drop sys.build_number. Add sys.subversion.
Martin v. Löwis <martin@v.loewis.de>
parents:
36070
diff
changeset
|
114 PyAPI_FUNC(const char *) _Py_svnversion(void); |
|
825a041813fb
Drop sys.build_number. Add sys.subversion.
Martin v. Löwis <martin@v.loewis.de>
parents:
36070
diff
changeset
|
115 PyAPI_FUNC(const char *) Py_SubversionRevision(void); |
|
825a041813fb
Drop sys.build_number. Add sys.subversion.
Martin v. Löwis <martin@v.loewis.de>
parents:
36070
diff
changeset
|
116 PyAPI_FUNC(const char *) Py_SubversionShortBranch(void); |
|
5862
4dbb4ec44d15
Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents:
5111
diff
changeset
|
117 |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
118 /* Internal -- various one-time initializations */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
119 PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
120 PyAPI_FUNC(PyObject *) _PySys_Init(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
121 PyAPI_FUNC(void) _PyImport_Init(void); |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
122 PyAPI_FUNC(void) _PyExc_Init(void); |
|
26885
54aacb87beda
PEP 302 + zipimport:
Just van Rossum <just@letterror.com>
parents:
26601
diff
changeset
|
123 PyAPI_FUNC(void) _PyImportHooks_Init(void); |
|
26923
dbfc3ef7d003
Since the *_Init() are private, prefix with _, suggested by Skip
Neal Norwitz <nnorwitz@gmail.com>
parents:
26889
diff
changeset
|
124 PyAPI_FUNC(int) _PyFrame_Init(void); |
|
27001
bda4185670cc
Move _PyInt_Init() into pythonrun.h, since all the other _Init()
Neal Norwitz <nnorwitz@gmail.com>
parents:
26923
diff
changeset
|
125 PyAPI_FUNC(int) _PyInt_Init(void); |
| 34972 | 126 PyAPI_FUNC(void) _PyFloat_Init(void); |
|
47291
04bd3690fb1f
First step of the C API rename:
Christian Heimes <christian@cheimes.de>
parents:
46118
diff
changeset
|
127 PyAPI_FUNC(int) PyByteArray_Init(void); |
|
5919
5da18e002b1a
Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents:
5862
diff
changeset
|
128 |
|
5984
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
129 /* Various internal finalizers */ |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
130 PyAPI_FUNC(void) _PyExc_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
131 PyAPI_FUNC(void) _PyImport_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
132 PyAPI_FUNC(void) PyMethod_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
133 PyAPI_FUNC(void) PyFrame_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
134 PyAPI_FUNC(void) PyCFunction_Fini(void); |
|
45229
262263737bce
Deallocate content of the dict free list on interpreter shutdown
Christian Heimes <christian@cheimes.de>
parents:
37418
diff
changeset
|
135 PyAPI_FUNC(void) PyDict_Fini(void); |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
136 PyAPI_FUNC(void) PyTuple_Fini(void); |
|
33679
55fba88930bc
Finalize the freelist of list objects.
Raymond Hettinger <python@rcn.com>
parents:
33189
diff
changeset
|
137 PyAPI_FUNC(void) PyList_Fini(void); |
|
35297
26bf6c27e9ce
* Improve code for the empty frozenset singleton:
Raymond Hettinger <python@rcn.com>
parents:
34972
diff
changeset
|
138 PyAPI_FUNC(void) PySet_Fini(void); |
|
47527
52294af4b663
This reverts r63675 based on the discussion in this thread:
Gregory P. Smith <greg@mad-scientist.com>
parents:
47294
diff
changeset
|
139 PyAPI_FUNC(void) PyString_Fini(void); |
|
24420
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
140 PyAPI_FUNC(void) PyInt_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
141 PyAPI_FUNC(void) PyFloat_Fini(void); |
|
36e2fd3f08f7
Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents:
24159
diff
changeset
|
142 PyAPI_FUNC(void) PyOS_FiniInterrupts(void); |
|
47291
04bd3690fb1f
First step of the C API rename:
Christian Heimes <christian@cheimes.de>
parents:
46118
diff
changeset
|
143 PyAPI_FUNC(void) PyByteArray_Fini(void); |
|
5984
b4bbba3af4e8
Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents:
5919
diff
changeset
|
144 |
|
5986
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
145 /* Stuff with no proper home (yet) */ |
|
25924
dc4a0336a2a3
Patch #512981: Update readline input stream on sys.stdin/out change.
Martin v. Löwis <martin@v.loewis.de>
parents:
24754
diff
changeset
|
146 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *); |
|
24754
8ab303375b30
Correct PyAPI_FUNC to PyAPI_DATA - sorry Jack.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24752
diff
changeset
|
147 PyAPI_DATA(int) (*PyOS_InputHook)(void); |
|
25924
dc4a0336a2a3
Patch #512981: Update readline input stream on sys.stdin/out change.
Martin v. Löwis <martin@v.loewis.de>
parents:
24754
diff
changeset
|
148 PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *); |
|
33070
4e6f4e9ec9b3
Patch #1006003: Cygwin standard module build problems
Jason Tishler <jason@tishler.net>
parents:
27878
diff
changeset
|
149 PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; |
|
14227
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
150 |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
151 /* Stack size, in "pointers" (so we get extra safety margins |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
152 on 64-bit platforms). On a 32-bit platform, this translates |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
153 to a 8k margin. */ |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
154 #define PYOS_STACK_MARGIN 2048 |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
155 |
|
47666
fcfe10f3dc14
Restore support for Microsoft VC6 compiler.
Amaury Forgeot d'Arc <amauryfa@gmail.com>
parents:
47527
diff
changeset
|
156 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300 |
|
14227
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
157 /* Enable stack checking under Microsoft C */ |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
158 #define USE_STACKCHECK |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
159 #endif |
|
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
160 |
|
13887
c0c17347da5b
Added a prototype for PyOS_CheckStack (within #ifdef USE_STACKCHECK).
Jack Jansen <jack.jansen@cwi.nl>
parents:
13445
diff
changeset
|
161 #ifdef USE_STACKCHECK |
|
14227
9f9f3280dc68
implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents:
13887
diff
changeset
|
162 /* Check that we aren't overflowing our stack */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
163 PyAPI_FUNC(int) PyOS_CheckStack(void); |
|
13887
c0c17347da5b
Added a prototype for PyOS_CheckStack (within #ifdef USE_STACKCHECK).
Jack Jansen <jack.jansen@cwi.nl>
parents:
13445
diff
changeset
|
164 #endif |
|
5986
32127593c134
Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents:
5984
diff
changeset
|
165 |
|
14636
0c303a22d9a4
Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
166 /* Signals */ |
|
0c303a22d9a4
Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
167 typedef void (*PyOS_sighandler_t)(int); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
168 PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24471
diff
changeset
|
169 PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); |
|
14636
0c303a22d9a4
Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
170 |
|
75100
6b7704fe1be1
- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
Barry Warsaw <barry@python.org>
parents:
61465
diff
changeset
|
171 /* Random */ |
|
6b7704fe1be1
- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
Barry Warsaw <barry@python.org>
parents:
61465
diff
changeset
|
172 PyAPI_FUNC(int) _PyOS_URandom (void *buffer, Py_ssize_t size); |
|
14636
0c303a22d9a4
Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
173 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
174 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
175 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
176 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1313
diff
changeset
|
177 #endif /* !Py_PYTHONRUN_H */ |
