Null commit with -f option to force an uprev and put HEADs firmly on the trunk.
[python/dscho.git] / Include / pythonrun.h
blobe7274ec489f384565820f25bbac674abdc606892
2 /* Interfaces to parse and execute pieces of python code */
4 #ifndef Py_PYTHONRUN_H
5 #define Py_PYTHONRUN_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 typedef struct {
11 int cf_nested_scopes;
12 } PyCompilerFlags;
14 DL_IMPORT(void) Py_SetProgramName(char *);
15 DL_IMPORT(char *) Py_GetProgramName(void);
17 DL_IMPORT(void) Py_SetPythonHome(char *);
18 DL_IMPORT(char *) Py_GetPythonHome(void);
20 DL_IMPORT(void) Py_Initialize(void);
21 DL_IMPORT(void) Py_Finalize(void);
22 DL_IMPORT(int) Py_IsInitialized(void);
23 DL_IMPORT(PyThreadState *) Py_NewInterpreter(void);
24 DL_IMPORT(void) Py_EndInterpreter(PyThreadState *);
26 DL_IMPORT(int) PyRun_AnyFile(FILE *, char *);
27 DL_IMPORT(int) PyRun_AnyFileEx(FILE *, char *, int);
29 DL_IMPORT(int) PyRun_AnyFileFlags(FILE *, char *, PyCompilerFlags *);
30 DL_IMPORT(int) PyRun_AnyFileExFlags(FILE *, char *, int, PyCompilerFlags *);
32 DL_IMPORT(int) PyRun_SimpleString(char *);
33 DL_IMPORT(int) PyRun_SimpleFile(FILE *, char *);
34 DL_IMPORT(int) PyRun_SimpleFileEx(FILE *, char *, int);
35 DL_IMPORT(int) PyRun_SimpleFileExFlags(FILE *, char *, int, PyCompilerFlags *);
36 DL_IMPORT(int) PyRun_InteractiveOne(FILE *, char *);
37 DL_IMPORT(int) PyRun_InteractiveOneFlags(FILE *, char *, PyCompilerFlags *);
38 DL_IMPORT(int) PyRun_InteractiveLoop(FILE *, char *);
39 DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
41 DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
42 DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
44 DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);
45 DL_IMPORT(PyObject *) PyRun_File(FILE *, char *, int, PyObject *, PyObject *);
46 DL_IMPORT(PyObject *) PyRun_FileEx(FILE *, char *, int,
47 PyObject *, PyObject *, int);
48 DL_IMPORT(PyObject *) PyRun_StringFlags(char *, int, PyObject *, PyObject *,
49 PyCompilerFlags *);
50 DL_IMPORT(PyObject *) PyRun_FileFlags(FILE *, char *, int, PyObject *,
51 PyObject *, PyCompilerFlags *);
52 DL_IMPORT(PyObject *) PyRun_FileExFlags(FILE *, char *, int, PyObject *,
53 PyObject *, int, PyCompilerFlags *);
55 DL_IMPORT(PyObject *) Py_CompileString(char *, char *, int);
56 DL_IMPORT(PyObject *) Py_CompileStringFlags(char *, char *, int,
57 PyCompilerFlags *);
58 DL_IMPORT(struct symtable *) Py_SymtableString(char *, char *, int);
60 DL_IMPORT(void) PyErr_Print(void);
61 DL_IMPORT(void) PyErr_PrintEx(int);
62 DL_IMPORT(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
64 DL_IMPORT(int) Py_AtExit(void (*func)(void));
66 DL_IMPORT(void) Py_Exit(int);
68 DL_IMPORT(int) Py_FdIsInteractive(FILE *, char *);
70 /* In getpath.c */
71 DL_IMPORT(char *) Py_GetProgramFullPath(void);
72 DL_IMPORT(char *) Py_GetPrefix(void);
73 DL_IMPORT(char *) Py_GetExecPrefix(void);
74 DL_IMPORT(char *) Py_GetPath(void);
76 /* In their own files */
77 DL_IMPORT(const char *) Py_GetVersion(void);
78 DL_IMPORT(const char *) Py_GetPlatform(void);
79 DL_IMPORT(const char *) Py_GetCopyright(void);
80 DL_IMPORT(const char *) Py_GetCompiler(void);
81 DL_IMPORT(const char *) Py_GetBuildInfo(void);
83 /* Internal -- various one-time initializations */
84 DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
85 DL_IMPORT(PyObject *) _PySys_Init(void);
86 DL_IMPORT(void) _PyImport_Init(void);
87 DL_IMPORT(void) init_exceptions(void);
89 /* Various internal finalizers */
90 DL_IMPORT(void) fini_exceptions(void);
91 DL_IMPORT(void) _PyImport_Fini(void);
92 DL_IMPORT(void) PyMethod_Fini(void);
93 DL_IMPORT(void) PyFrame_Fini(void);
94 DL_IMPORT(void) PyCFunction_Fini(void);
95 DL_IMPORT(void) PyTuple_Fini(void);
96 DL_IMPORT(void) PyString_Fini(void);
97 DL_IMPORT(void) PyInt_Fini(void);
98 DL_IMPORT(void) PyFloat_Fini(void);
99 DL_IMPORT(void) PyOS_FiniInterrupts(void);
101 /* Stuff with no proper home (yet) */
102 DL_IMPORT(char *) PyOS_Readline(char *);
103 extern DL_IMPORT(int) (*PyOS_InputHook)(void);
104 extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
106 /* Stack size, in "pointers" (so we get extra safety margins
107 on 64-bit platforms). On a 32-bit platform, this translates
108 to a 8k margin. */
109 #define PYOS_STACK_MARGIN 2048
111 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER)
112 /* Enable stack checking under Microsoft C */
113 #define USE_STACKCHECK
114 #endif
116 #ifdef USE_STACKCHECK
117 /* Check that we aren't overflowing our stack */
118 DL_IMPORT(int) PyOS_CheckStack(void);
119 #endif
121 /* Signals */
122 typedef void (*PyOS_sighandler_t)(int);
123 DL_IMPORT(PyOS_sighandler_t) PyOS_getsig(int);
124 DL_IMPORT(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
127 #ifdef __cplusplus
129 #endif
130 #endif /* !Py_PYTHONRUN_H */