annotate Include/pythonrun.h @ 86966:af822a6c9faf

Issue #19512: Add PyRun_InteractiveOneObject() function Only decode the filename once. PyRun_InteractiveOneObject() uses an identifier for "<string>" string, so the byte string is only decoded once.
author Victor Stinner <victor.stinner@gmail.com>
date Wed, 06 Nov 2013 18:41:07 +0100
parents 3055e61f1e66
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 86
diff changeset
1
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Interfaces to parse and execute pieces of python code */
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
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
55062
65e41bcbc25d Merged revisions 73782-73784 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 52641
diff changeset
10 #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
65e41bcbc25d Merged revisions 73782-73784 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 52641
diff changeset
11 CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
65e41bcbc25d Merged revisions 73782-73784 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 52641
diff changeset
12 CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL)
65e41bcbc25d Merged revisions 73782-73784 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 52641
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
51956
8fe2988cf550 ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626
Benjamin Peterson <benjamin@python.org>
parents: 47667
diff changeset
17 #define PyCF_IGNORE_COOKIE 0x0800
19350
5b6a6d7d44ae ceval, PyEval_MergeCompilerFlags: wasn't merging in the
Tim Peters <tim.peters@gmail.com>
parents: 19157
diff changeset
18
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
19 #ifndef Py_LIMITED_API
16916
b0456d3a0f1f Useful future statement support for the interactive interpreter
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 16421
diff changeset
20 typedef struct {
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
21 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
22 } PyCompilerFlags;
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
23 #endif
16916
b0456d3a0f1f Useful future statement support for the interactive interpreter
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 16421
diff changeset
24
46318
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
25 PyAPI_FUNC(void) Py_SetProgramName(wchar_t *);
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
26 PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
7208
ce271e5f9bc5 - Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
Guido van Rossum <guido@python.org>
parents: 6192
diff changeset
27
46318
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
28 PyAPI_FUNC(void) Py_SetPythonHome(wchar_t *);
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
29 PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
30
86426
12d7b6171b28 Issue #16129: Py_SetStandardStreamEncoding cleanups
Nick Coghlan <ncoghlan@gmail.com>
parents: 86400
diff changeset
31 #ifndef Py_LIMITED_API
12d7b6171b28 Issue #16129: Py_SetStandardStreamEncoding cleanups
Nick Coghlan <ncoghlan@gmail.com>
parents: 86400
diff changeset
32 /* Only used by applications that embed the interpreter and need to
12d7b6171b28 Issue #16129: Py_SetStandardStreamEncoding cleanups
Nick Coghlan <ncoghlan@gmail.com>
parents: 86400
diff changeset
33 * override the standard encoding determination mechanism
12d7b6171b28 Issue #16129: Py_SetStandardStreamEncoding cleanups
Nick Coghlan <ncoghlan@gmail.com>
parents: 86400
diff changeset
34 */
86400
537e13ca7683 Issue #16129: Move Py_SetStandardStreamEncoding declaration
Nick Coghlan <ncoghlan@gmail.com>
parents: 86399
diff changeset
35 PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
537e13ca7683 Issue #16129: Move Py_SetStandardStreamEncoding declaration
Nick Coghlan <ncoghlan@gmail.com>
parents: 86399
diff changeset
36 const char *errors);
86426
12d7b6171b28 Issue #16129: Py_SetStandardStreamEncoding cleanups
Nick Coghlan <ncoghlan@gmail.com>
parents: 86400
diff changeset
37 #endif
86400
537e13ca7683 Issue #16129: Move Py_SetStandardStreamEncoding declaration
Nick Coghlan <ncoghlan@gmail.com>
parents: 86399
diff changeset
38
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
39 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
40 PyAPI_FUNC(void) Py_InitializeEx(int);
77519
c3616595dada Issue #14928: Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
Antoine Pitrou <solipsis@pitrou.net>
parents: 77318
diff changeset
41 #ifndef Py_LIMITED_API
c3616595dada Issue #14928: Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
Antoine Pitrou <solipsis@pitrou.net>
parents: 77318
diff changeset
42 PyAPI_FUNC(void) _Py_InitializeEx_Private(int, int);
c3616595dada Issue #14928: Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
Antoine Pitrou <solipsis@pitrou.net>
parents: 77318
diff changeset
43 #endif
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
44 PyAPI_FUNC(void) Py_Finalize(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
45 PyAPI_FUNC(int) Py_IsInitialized(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
46 PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
47 PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
13445
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
48
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
49 #ifndef Py_LIMITED_API
26601
cc05c2c8660e Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents: 25924
diff changeset
50 PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
36768
d6c30ce3868b Reconst parameters that lost their const in the AST merge.
Martin v. Löwis <martin@v.loewis.de>
parents: 36726
diff changeset
51 PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
52 PyAPI_FUNC(int) PyRun_AnyFileExFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
53 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
54 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
55 int closeit,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
56 PyCompilerFlags *flags);
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
57 PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
58 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
59 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
60 int closeit,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
61 PyCompilerFlags *flags);
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
62 PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
63 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
64 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
65 PyCompilerFlags *flags);
86966
af822a6c9faf Issue #19512: Add PyRun_InteractiveOneObject() function
Victor Stinner <victor.stinner@gmail.com>
parents: 86484
diff changeset
66 PyAPI_FUNC(int) PyRun_InteractiveOneObject(
af822a6c9faf Issue #19512: Add PyRun_InteractiveOneObject() function
Victor Stinner <victor.stinner@gmail.com>
parents: 86484
diff changeset
67 FILE *fp,
af822a6c9faf Issue #19512: Add PyRun_InteractiveOneObject() function
Victor Stinner <victor.stinner@gmail.com>
parents: 86484
diff changeset
68 PyObject *filename,
af822a6c9faf Issue #19512: Add PyRun_InteractiveOneObject() function
Victor Stinner <victor.stinner@gmail.com>
parents: 86484
diff changeset
69 PyCompilerFlags *flags);
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
70 PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
71 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
72 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
73 PyCompilerFlags *flags);
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
74
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
75 PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
76 const char *s,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
77 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
78 int start,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
79 PyCompilerFlags *flags,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
80 PyArena *arena);
85417
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
81 PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject(
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
82 const char *s,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
83 PyObject *filename,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
84 int start,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
85 PyCompilerFlags *flags,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
86 PyArena *arena);
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
87 PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
88 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
89 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
90 const char* enc,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
91 int start,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
92 char *ps1,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
93 char *ps2,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
94 PyCompilerFlags *flags,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
95 int *errcode,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
96 PyArena *arena);
85417
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
97 PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject(
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
98 FILE *fp,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
99 PyObject *filename,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
100 const char* enc,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
101 int start,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
102 char *ps1,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
103 char *ps2,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
104 PyCompilerFlags *flags,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
105 int *errcode,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
106 PyArena *arena);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
107 #endif
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
108
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
109 #ifndef PyParser_SimpleParseString
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
110 #define PyParser_SimpleParseString(S, B) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
111 PyParser_SimpleParseStringFlags(S, B, 0)
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
112 #define PyParser_SimpleParseFile(FP, S, B) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
113 PyParser_SimpleParseFileFlags(FP, S, B, 0)
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
114 #endif
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
115 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
77318
90f0dd118aa4 Issue #14090: fix some minor C API problems in default branch (3.3)
Eli Bendersky <eliben@gmail.com>
parents: 76303
diff changeset
116 int);
90f0dd118aa4 Issue #14090: fix some minor C API problems in default branch (3.3)
Eli Bendersky <eliben@gmail.com>
parents: 76303
diff changeset
117 PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *,
90f0dd118aa4 Issue #14090: fix some minor C API problems in default branch (3.3)
Eli Bendersky <eliben@gmail.com>
parents: 76303
diff changeset
118 const char *,
90f0dd118aa4 Issue #14090: fix some minor C API problems in default branch (3.3)
Eli Bendersky <eliben@gmail.com>
parents: 76303
diff changeset
119 int, int);
26601
cc05c2c8660e Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents: 25924
diff changeset
120 PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
77318
90f0dd118aa4 Issue #14090: fix some minor C API problems in default branch (3.3)
Eli Bendersky <eliben@gmail.com>
parents: 76303
diff changeset
121 int, int);
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
122
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
123 #ifndef Py_LIMITED_API
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
124 PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
125 PyObject *, PyCompilerFlags *);
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
126
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
127 PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
128 FILE *fp,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
129 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
130 int start,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
131 PyObject *globals,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
132 PyObject *locals,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
133 int closeit,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
134 PyCompilerFlags *flags);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
135 #endif
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
136
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
137 #ifdef Py_LIMITED_API
66696
bede83e20853 Expose CompileString, not CompileStringFlags under the
Martin v. Löwis <martin@v.loewis.de>
parents: 66685
diff changeset
138 PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
139 #else
66685
713c6b6ca5ce Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile.
Georg Brandl <georg@python.org>
parents: 66664
diff changeset
140 #define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
713c6b6ca5ce Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile.
Georg Brandl <georg@python.org>
parents: 66664
diff changeset
141 #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
142 PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
143 const char *str,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
144 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
145 int start,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
146 PyCompilerFlags *flags,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
147 int optimize);
85417
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
148 PyAPI_FUNC(PyObject *) Py_CompileStringObject(
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
149 const char *str,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
150 PyObject *filename, int start,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
151 PyCompilerFlags *flags,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
152 int optimize);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
153 #endif
67151
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
154 PyAPI_FUNC(struct symtable *) Py_SymtableString(
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
155 const char *str,
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
156 const char *filename, /* decoded from the filesystem encoding */
66d8446a019b Issue #9738: Document encodings of AST, compiler, parser and PyRun functions
Victor Stinner <victor.stinner@haypocalc.com>
parents: 66696
diff changeset
157 int start);
85417
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
158 PyAPI_FUNC(struct symtable *) Py_SymtableStringObject(
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
159 const char *str,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
160 PyObject *filename,
df2fdd42b375 Close #11619: The parser and the import machinery do not encode Unicode
Victor Stinner <victor.stinner@gmail.com>
parents: 84793
diff changeset
161 int start);
1263
65a1e4e9cd54 * Fixed some subtleties with fastlocals. You can no longer access
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
162
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
163 PyAPI_FUNC(void) PyErr_Print(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
164 PyAPI_FUNC(void) PyErr_PrintEx(int);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
165 PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
86
a6934380c6e7 "Compiling" version
Guido van Rossum <guido@python.org>
parents:
diff changeset
166
41253
f29f1a8b7869 Patch #1680961: remove sys.exitfunc and replace it with a private C API. Also, reimplement atexit in C so it can take advantage of this private API.
Collin Winter <collinw@gmail.com>
parents: 40978
diff changeset
167 /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
f29f1a8b7869 Patch #1680961: remove sys.exitfunc and replace it with a private C API. Also, reimplement atexit in C so it can take advantage of this private API.
Collin Winter <collinw@gmail.com>
parents: 40978
diff changeset
168 * exit functions.
f29f1a8b7869 Patch #1680961: remove sys.exitfunc and replace it with a private C API. Also, reimplement atexit in C so it can take advantage of this private API.
Collin Winter <collinw@gmail.com>
parents: 40978
diff changeset
169 */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
170 #ifndef Py_LIMITED_API
41253
f29f1a8b7869 Patch #1680961: remove sys.exitfunc and replace it with a private C API. Also, reimplement atexit in C so it can take advantage of this private API.
Collin Winter <collinw@gmail.com>
parents: 40978
diff changeset
171 PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void));
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
172 #endif
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
173 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
174
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
175 PyAPI_FUNC(void) Py_Exit(int);
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1313
diff changeset
176
59605
768722b2ae0a * Replaces the internals of the subprocess module from fork through exec on
Gregory P. Smith <greg@mad-scientist.com>
parents: 55060
diff changeset
177 /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
178 #ifndef Py_LIMITED_API
59605
768722b2ae0a * Replaces the internals of the subprocess module from fork through exec on
Gregory P. Smith <greg@mad-scientist.com>
parents: 55060
diff changeset
179 PyAPI_FUNC(void) _Py_RestoreSignals(void);
768722b2ae0a * Replaces the internals of the subprocess module from fork through exec on
Gregory P. Smith <greg@mad-scientist.com>
parents: 55060
diff changeset
180
26601
cc05c2c8660e Constify filenames and scripts. Fixes #651362.
Martin v. Löwis <martin@v.loewis.de>
parents: 25924
diff changeset
181 PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
182 #endif
5111
21b871325c85 Added decl for Py_FdIsInteractive.
Guido van Rossum <guido@python.org>
parents: 4503
diff changeset
183
24471
f66b3a3509c7 Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents: 24420
diff changeset
184 /* Bootstrap */
46318
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
185 PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
24471
f66b3a3509c7 Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
Mark Hammond <mhammond@skippinet.com.au>
parents: 24420
diff changeset
186
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
187 #ifndef Py_LIMITED_API
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
188 /* Use macros for a bunch of old variants */
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
189 #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
190 #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
191 #define PyRun_AnyFileEx(fp, name, closeit) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
192 PyRun_AnyFileExFlags(fp, name, closeit, NULL)
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
193 #define PyRun_AnyFileFlags(fp, name, flags) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
194 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
195 #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
196 #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
197 #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
198 #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
199 #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
200 #define PyRun_File(fp, p, s, g, l) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
201 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
202 #define PyRun_FileEx(fp, p, s, g, l, c) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
203 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
204 #define PyRun_FileFlags(fp, p, s, g, l, flags) \
61467
f197407bdba2 Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents: 55062
diff changeset
205 PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
206 #endif
35742
1c4d192f1568 Merge ast-branch to head
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 35297
diff changeset
207
5862
4dbb4ec44d15 Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents: 5111
diff changeset
208 /* In getpath.c */
46318
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
209 PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
210 PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
211 PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
22a74eaf6b22 Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents: 45244
diff changeset
212 PyAPI_FUNC(wchar_t *) Py_GetPath(void);
64955
fd5e51035335 issue 9910
Kristján Valur Jónsson <kristjan@ccpgames.com>
parents: 63852
diff changeset
213 PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
214 #ifdef MS_WINDOWS
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
215 int _Py_CheckPython3();
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
216 #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
217
4dbb4ec44d15 Added declarations for Py_{Set,Get}ProgramName() and a bunch of other
Guido van Rossum <guido@python.org>
parents: 5111
diff changeset
218 /* 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
219 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
220 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
221 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
222 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
223 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
224 #ifndef Py_LIMITED_API
68274
f57c94073b35 Commit the hg build identification patch from the pymigr repo.
Georg Brandl <georg@python.org>
parents: 61467
diff changeset
225 PyAPI_FUNC(const char *) _Py_hgidentifier(void);
f57c94073b35 Commit the hg build identification patch from the pymigr repo.
Georg Brandl <georg@python.org>
parents: 61467
diff changeset
226 PyAPI_FUNC(const char *) _Py_hgversion(void);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
227 #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
228
5919
5da18e002b1a Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents: 5862
diff changeset
229 /* Internal -- various one-time initializations */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
230 #ifndef Py_LIMITED_API
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
231 PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
232 PyAPI_FUNC(PyObject *) _PySys_Init(void);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
233 PyAPI_FUNC(void) _PyImport_Init(void);
76303
2dd046be2c88 Issue #2377: Make importlib the implementation of __import__().
Brett Cannon <brett@python.org>
parents: 75143
diff changeset
234 PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod);
26885
54aacb87beda PEP 302 + zipimport:
Just van Rossum <just@letterror.com>
parents: 26601
diff changeset
235 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
236 PyAPI_FUNC(int) _PyFrame_Init(void);
84793
fc718c177ee6 Issue #18520: Add a new PyStructSequence_InitType2() function, same than
Victor Stinner <victor.stinner@gmail.com>
parents: 83650
diff changeset
237 PyAPI_FUNC(int) _PyFloat_Init(void);
47300
96b34263e448 Renamed PyBytes to PyByteArray
Christian Heimes <christian@cheimes.de>
parents: 46318
diff changeset
238 PyAPI_FUNC(int) PyByteArray_Init(void);
75142
0e8bd4785ea0 Fix test failure in test_cmd_line by initializing the hash secret at the earliest point.
Antoine Pitrou <solipsis@pitrou.net>
parents: 75073
diff changeset
239 PyAPI_FUNC(void) _PyRandom_Init(void);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
240 #endif
5919
5da18e002b1a Mass checkin (more to follow for other directories).
Guido van Rossum <guido@python.org>
parents: 5862
diff changeset
241
5984
b4bbba3af4e8 Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
242 /* Various internal finalizers */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
243 #ifndef Py_LIMITED_API
24420
36e2fd3f08f7 Excise DL_IMPORT/EXPORT from object.h, and related files. This patch
Mark Hammond <mhammond@skippinet.com.au>
parents: 24159
diff changeset
244 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
245 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
246 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
247 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
248 PyAPI_FUNC(void) PyCFunction_Fini(void);
45244
2a821e001a2b Merged revisions 60481,60485,60489-60492,60494-60496,60498-60499,60501-60503,60505-60506,60508-60509,60523-60524,60532,60543,60545,60547-60548,60552,60554,60556-60559,60561-60562,60569,60571-60572,60574,60576-60583,60585-60586,60589,60591,60594-60595,60597-60598,60600-60601,60606-60612,60615,60617-60678 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents: 44099
diff changeset
249 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
250 PyAPI_FUNC(void) PyTuple_Fini(void);
33679
55fba88930bc Finalize the freelist of list objects.
Raymond Hettinger <python@rcn.com>
parents: 33189
diff changeset
251 PyAPI_FUNC(void) PyList_Fini(void);
35297
26bf6c27e9ce * Improve code for the empty frozenset singleton:
Raymond Hettinger <python@rcn.com>
parents: 34972
diff changeset
252 PyAPI_FUNC(void) PySet_Fini(void);
47301
23ab586c427a Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents: 47300
diff changeset
253 PyAPI_FUNC(void) PyBytes_Fini(void);
47300
96b34263e448 Renamed PyBytes to PyByteArray
Christian Heimes <christian@cheimes.de>
parents: 46318
diff changeset
254 PyAPI_FUNC(void) PyByteArray_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
255 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
256 PyAPI_FUNC(void) PyOS_FiniInterrupts(void);
83650
f0833e6ff2d2 Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown.
Antoine Pitrou <solipsis@pitrou.net>
parents: 83612
diff changeset
257 PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void);
63852
1bd3534136a0 Issue #477863: Print a warning at shutdown if gc.garbage is not empty.
Antoine Pitrou <solipsis@pitrou.net>
parents: 61466
diff changeset
258 PyAPI_FUNC(void) _PyGC_Fini(void);
73617
fa2f8dd077e0 Issue #10227: Add an allocation cache for a single slice object.
Antoine Pitrou <solipsis@pitrou.net>
parents: 69833
diff changeset
259 PyAPI_FUNC(void) PySlice_Fini(void);
83612
8c1385205a35 Issue #17408: Avoid using an obsolete instance of the copyreg module when the interpreter is shutdown and then started again.
Antoine Pitrou <solipsis@pitrou.net>
parents: 77519
diff changeset
260 PyAPI_FUNC(void) _PyType_Fini(void);
85468
acc7439b1406 Issue #18756: os.urandom() now uses a lazily-opened persistent file descriptor, so as to avoid using many file descriptors when run in parallel from multiple threads.
Antoine Pitrou <solipsis@pitrou.net>
parents: 85417
diff changeset
261 PyAPI_FUNC(void) _PyRandom_Fini(void);
69832
2a19d09b08f8 Issue #1856: Avoid crashes and lockups when daemon threads run while the
Antoine Pitrou <solipsis@pitrou.net>
parents: 68276
diff changeset
262
2a19d09b08f8 Issue #1856: Avoid crashes and lockups when daemon threads run while the
Antoine Pitrou <solipsis@pitrou.net>
parents: 68276
diff changeset
263 PyAPI_DATA(PyThreadState *) _Py_Finalizing;
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
264 #endif
5984
b4bbba3af4e8 Added prototype for various finalizers.
Guido van Rossum <guido@python.org>
parents: 5919
diff changeset
265
5986
32127593c134 Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents: 5984
diff changeset
266 /* Stuff with no proper home (yet) */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
267 #ifndef Py_LIMITED_API
86484
3055e61f1e66 Issue #1772673: The type of `char*` arguments now changed to `const char*`.
Serhiy Storchaka <storchaka@gmail.com>
parents: 86426
diff changeset
268 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
269 #endif
24754
8ab303375b30 Correct PyAPI_FUNC to PyAPI_DATA - sorry Jack.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24752
diff changeset
270 PyAPI_DATA(int) (*PyOS_InputHook)(void);
86484
3055e61f1e66 Issue #1772673: The type of `char*` arguments now changed to `const char*`.
Serhiy Storchaka <storchaka@gmail.com>
parents: 86426
diff changeset
271 PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
272 #ifndef Py_LIMITED_API
33070
4e6f4e9ec9b3 Patch #1006003: Cygwin standard module build problems
Jason Tishler <jason@tishler.net>
parents: 27878
diff changeset
273 PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 64955
diff changeset
274 #endif
14227
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
275
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
276 /* 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
277 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
278 to a 8k margin. */
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
279 #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
280
47667
b1f4ea4eb555 Merged revisions 64214 via svnmerge from
Amaury Forgeot d'Arc <amauryfa@gmail.com>
parents: 47301
diff changeset
281 #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
282 /* 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
283 #define USE_STACKCHECK
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
284 #endif
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
285
13887
c0c17347da5b Added a prototype for PyOS_CheckStack (within #ifdef USE_STACKCHECK).
Jack Jansen <jack.jansen@cwi.nl>
parents: 13445
diff changeset
286 #ifdef USE_STACKCHECK
14227
9f9f3280dc68 implements PyOS_CheckStack for Windows and MSVC. this fixes a
Fredrik Lundh <fredrik@pythonware.com>
parents: 13887
diff changeset
287 /* 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
288 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
289 #endif
5986
32127593c134 Added decls for stuff from myreadline.
Guido van Rossum <guido@python.org>
parents: 5984
diff changeset
290
14636
0c303a22d9a4 Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
291 /* Signals */
0c303a22d9a4 Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
292 typedef void (*PyOS_sighandler_t)(int);
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
293 PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 24471
diff changeset
294 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
295
75066
f4b7ecf8a5f8 Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
Georg Brandl <georg@python.org>
parents: 68274
diff changeset
296 /* Random */
f4b7ecf8a5f8 Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
Georg Brandl <georg@python.org>
parents: 68274
diff changeset
297 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
298
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1313
diff changeset
299 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1313
diff changeset
300 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1313
diff changeset
301 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1313
diff changeset
302 #endif /* !Py_PYTHONRUN_H */