]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Include/pythonrun.h
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Include / pythonrun.h
CommitLineData
4710c53d 1\r
2/* Interfaces to parse and execute pieces of python code */\r
3\r
4#ifndef Py_PYTHONRUN_H\r
5#define Py_PYTHONRUN_H\r
6#ifdef __cplusplus\r
7extern "C" {\r
8#endif\r
9\r
10#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \\r
11 CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \\r
12 CO_FUTURE_UNICODE_LITERALS)\r
13#define PyCF_MASK_OBSOLETE (CO_NESTED)\r
14#define PyCF_SOURCE_IS_UTF8 0x0100\r
15#define PyCF_DONT_IMPLY_DEDENT 0x0200\r
16#define PyCF_ONLY_AST 0x0400\r
17\r
18typedef struct {\r
19 int cf_flags; /* bitmask of CO_xxx flags relevant to future */\r
20} PyCompilerFlags;\r
21\r
22PyAPI_FUNC(void) Py_SetProgramName(char *);\r
23PyAPI_FUNC(char *) Py_GetProgramName(void);\r
24\r
25PyAPI_FUNC(void) Py_SetPythonHome(char *);\r
26PyAPI_FUNC(char *) Py_GetPythonHome(void);\r
27\r
28PyAPI_FUNC(void) Py_Initialize(void);\r
29PyAPI_FUNC(void) Py_InitializeEx(int);\r
30PyAPI_FUNC(void) Py_Finalize(void);\r
31PyAPI_FUNC(int) Py_IsInitialized(void);\r
32PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);\r
33PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);\r
34\r
35PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);\r
36PyAPI_FUNC(int) PyRun_AnyFileExFlags(FILE *, const char *, int, PyCompilerFlags *);\r
37PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);\r
38PyAPI_FUNC(int) PyRun_SimpleFileExFlags(FILE *, const char *, int, PyCompilerFlags *);\r
39PyAPI_FUNC(int) PyRun_InteractiveOneFlags(FILE *, const char *, PyCompilerFlags *);\r
40PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(FILE *, const char *, PyCompilerFlags *);\r
41\r
42PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(const char *, const char *,\r
43 int, PyCompilerFlags *flags,\r
44 PyArena *);\r
45PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(FILE *, const char *, int,\r
46 char *, char *,\r
47 PyCompilerFlags *, int *,\r
48 PyArena *);\r
49#define PyParser_SimpleParseString(S, B) \\r
50 PyParser_SimpleParseStringFlags(S, B, 0)\r
51#define PyParser_SimpleParseFile(FP, S, B) \\r
52 PyParser_SimpleParseFileFlags(FP, S, B, 0)\r
53PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,\r
54 int);\r
55PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,\r
56 int, int);\r
57\r
58PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,\r
59 PyObject *, PyCompilerFlags *);\r
60\r
61PyAPI_FUNC(PyObject *) PyRun_FileExFlags(FILE *, const char *, int,\r
62 PyObject *, PyObject *, int,\r
63 PyCompilerFlags *);\r
64\r
65#define Py_CompileString(str, p, s) Py_CompileStringFlags(str, p, s, NULL)\r
66PyAPI_FUNC(PyObject *) Py_CompileStringFlags(const char *, const char *, int,\r
67 PyCompilerFlags *);\r
68PyAPI_FUNC(struct symtable *) Py_SymtableString(const char *, const char *, int);\r
69\r
70PyAPI_FUNC(void) PyErr_Print(void);\r
71PyAPI_FUNC(void) PyErr_PrintEx(int);\r
72PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);\r
73\r
74PyAPI_FUNC(int) Py_AtExit(void (*func)(void));\r
75\r
76PyAPI_FUNC(void) Py_Exit(int);\r
77\r
78PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);\r
79\r
80/* Bootstrap */\r
81PyAPI_FUNC(int) Py_Main(int argc, char **argv);\r
82\r
83/* Use macros for a bunch of old variants */\r
84#define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)\r
85#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)\r
86#define PyRun_AnyFileEx(fp, name, closeit) \\r
87 PyRun_AnyFileExFlags(fp, name, closeit, NULL)\r
88#define PyRun_AnyFileFlags(fp, name, flags) \\r
89 PyRun_AnyFileExFlags(fp, name, 0, flags)\r
90#define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL)\r
91#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL)\r
92#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL)\r
93#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL)\r
94#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL)\r
95#define PyRun_File(fp, p, s, g, l) \\r
96 PyRun_FileExFlags(fp, p, s, g, l, 0, NULL)\r
97#define PyRun_FileEx(fp, p, s, g, l, c) \\r
98 PyRun_FileExFlags(fp, p, s, g, l, c, NULL)\r
99#define PyRun_FileFlags(fp, p, s, g, l, flags) \\r
100 PyRun_FileExFlags(fp, p, s, g, l, 0, flags)\r
101\r
102/* In getpath.c */\r
103PyAPI_FUNC(char *) Py_GetProgramFullPath(void);\r
104PyAPI_FUNC(char *) Py_GetPrefix(void);\r
105PyAPI_FUNC(char *) Py_GetExecPrefix(void);\r
106PyAPI_FUNC(char *) Py_GetPath(void);\r
107\r
108/* In their own files */\r
109PyAPI_FUNC(const char *) Py_GetVersion(void);\r
110PyAPI_FUNC(const char *) Py_GetPlatform(void);\r
111PyAPI_FUNC(const char *) Py_GetCopyright(void);\r
112PyAPI_FUNC(const char *) Py_GetCompiler(void);\r
113PyAPI_FUNC(const char *) Py_GetBuildInfo(void);\r
114PyAPI_FUNC(const char *) _Py_svnversion(void);\r
115PyAPI_FUNC(const char *) Py_SubversionRevision(void);\r
116PyAPI_FUNC(const char *) Py_SubversionShortBranch(void);\r
117PyAPI_FUNC(const char *) _Py_hgidentifier(void);\r
118PyAPI_FUNC(const char *) _Py_hgversion(void);\r
119\r
120/* Internal -- various one-time initializations */\r
121PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void);\r
122PyAPI_FUNC(PyObject *) _PySys_Init(void);\r
123PyAPI_FUNC(void) _PyImport_Init(void);\r
124PyAPI_FUNC(void) _PyExc_Init(void);\r
125PyAPI_FUNC(void) _PyImportHooks_Init(void);\r
126PyAPI_FUNC(int) _PyFrame_Init(void);\r
127PyAPI_FUNC(int) _PyInt_Init(void);\r
128PyAPI_FUNC(int) _PyLong_Init(void);\r
129PyAPI_FUNC(void) _PyFloat_Init(void);\r
130PyAPI_FUNC(int) PyByteArray_Init(void);\r
131\r
132/* Various internal finalizers */\r
133PyAPI_FUNC(void) _PyExc_Fini(void);\r
134PyAPI_FUNC(void) _PyImport_Fini(void);\r
135PyAPI_FUNC(void) PyMethod_Fini(void);\r
136PyAPI_FUNC(void) PyFrame_Fini(void);\r
137PyAPI_FUNC(void) PyCFunction_Fini(void);\r
138PyAPI_FUNC(void) PyDict_Fini(void);\r
139PyAPI_FUNC(void) PyTuple_Fini(void);\r
140PyAPI_FUNC(void) PyList_Fini(void);\r
141PyAPI_FUNC(void) PySet_Fini(void);\r
142PyAPI_FUNC(void) PyString_Fini(void);\r
143PyAPI_FUNC(void) PyInt_Fini(void);\r
144PyAPI_FUNC(void) PyFloat_Fini(void);\r
145PyAPI_FUNC(void) PyOS_FiniInterrupts(void);\r
146PyAPI_FUNC(void) PyByteArray_Fini(void);\r
147\r
148/* Stuff with no proper home (yet) */\r
149PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);\r
150PyAPI_DATA(int) (*PyOS_InputHook)(void);\r
151PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, char *);\r
152PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;\r
153\r
154/* Stack size, in "pointers" (so we get extra safety margins\r
155 on 64-bit platforms). On a 32-bit platform, this translates\r
156 to a 8k margin. */\r
157#define PYOS_STACK_MARGIN 2048\r
158\r
159#if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300\r
160/* Enable stack checking under Microsoft C */\r
161#define USE_STACKCHECK\r
162#endif\r
163\r
164#ifdef USE_STACKCHECK\r
165/* Check that we aren't overflowing our stack */\r
166PyAPI_FUNC(int) PyOS_CheckStack(void);\r
167#endif\r
168\r
169/* Signals */\r
170typedef void (*PyOS_sighandler_t)(int);\r
171PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);\r
172PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);\r
173\r
174\r
175#ifdef __cplusplus\r
176}\r
177#endif\r
178#endif /* !Py_PYTHONRUN_H */\r