codekingpro/portable-devtools
115k
1#ifndef Py_CPYTHON_PYTHONRUN_H2# error "this header file must not be included directly"3#endif4 5PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);6PyAPI_FUNC(int) PyRun_AnyFileExFlags(7 FILE *fp,8 const char *filename, /* decoded from the filesystem encoding */9 int closeit,10 PyCompilerFlags *flags);11PyAPI_FUNC(int) PyRun_SimpleFileExFlags(12 FILE *fp,13 const char *filename, /* decoded from the filesystem encoding */14 int closeit,15 PyCompilerFlags *flags);16PyAPI_FUNC(int) PyRun_InteractiveOneFlags(17 FILE *fp,18 const char *filename, /* decoded from the filesystem encoding */19 PyCompilerFlags *flags);20PyAPI_FUNC(int) PyRun_InteractiveOneObject(21 FILE *fp,22 PyObject *filename,23 PyCompilerFlags *flags);24PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(25 FILE *fp,26 const char *filename, /* decoded from the filesystem encoding */27 PyCompilerFlags *flags);28 29 30PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,31 PyObject *, PyCompilerFlags *);32 33PyAPI_FUNC(PyObject *) PyRun_FileExFlags(34 FILE *fp,35 const char *filename, /* decoded from the filesystem encoding */36 int start,37 PyObject *globals,38 PyObject *locals,39 int closeit,40 PyCompilerFlags *flags);41 42 43PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(44 const char *str,45 const char *filename, /* decoded from the filesystem encoding */46 int start,47 PyCompilerFlags *flags,48 int optimize);49PyAPI_FUNC(PyObject *) Py_CompileStringObject(50 const char *str,51 PyObject *filename, int start,52 PyCompilerFlags *flags,53 int optimize);54 55#define Py_CompileString(str, p, s) Py_CompileStringExFlags((str), (p), (s), NULL, -1)56#define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags((str), (p), (s), (f), -1)57 58/* A function flavor is also exported by libpython. It is required when59 libpython is accessed directly rather than using header files which defines60 macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to61 export functions in pythonXX.dll. */62PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l);63PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name);64PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit);65PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);66PyAPI_FUNC(int) PyRun_SimpleString(const char *s);67PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p);68PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c);69PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p);70PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p);71PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l);72PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c);73PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags);74 75/* Use macros for a bunch of old variants */76#define PyRun_String(str, s, g, l) PyRun_StringFlags((str), (s), (g), (l), NULL)77#define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags((fp), (name), 0, NULL)78#define PyRun_AnyFileEx(fp, name, closeit) \79 PyRun_AnyFileExFlags((fp), (name), (closeit), NULL)80#define PyRun_AnyFileFlags(fp, name, flags) \81 PyRun_AnyFileExFlags((fp), (name), 0, (flags))82#define PyRun_SimpleString(s) PyRun_SimpleStringFlags((s), NULL)83#define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags((f), (p), 0, NULL)84#define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags((f), (p), (c), NULL)85#define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags((f), (p), NULL)86#define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags((f), (p), NULL)87#define PyRun_File(fp, p, s, g, l) \88 PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, NULL)89#define PyRun_FileEx(fp, p, s, g, l, c) \90 PyRun_FileExFlags((fp), (p), (s), (g), (l), (c), NULL)91#define PyRun_FileFlags(fp, p, s, g, l, flags) \92 PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, (flags))93 94/* Stuff with no proper home (yet) */95PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);96PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);97 