| 
									
										
										
										
											1991-02-19 12:39:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1990-12-20 15:06:42 +00:00
										 |  |  | /* Interfaces to parse and execute pieces of python code */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-07-09 00:55:06 +00:00
										 |  |  | #ifndef Py_PYTHONRUN_H
 | 
					
						
							|  |  |  | #define Py_PYTHONRUN_H
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							|  |  |  | PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); | 
					
						
							| 
									
										
										
										
											2006-03-01 16:55:42 +00:00
										 |  |  | PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(int) PyRun_AnyFileExFlags( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int closeit, | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							|  |  |  | PyAPI_FUNC(int) PyRun_SimpleFileExFlags( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int closeit, | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							|  |  |  | PyAPI_FUNC(int) PyRun_InteractiveOneFlags( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							| 
									
										
										
										
											2013-11-06 18:41:07 +01:00
										 |  |  | PyAPI_FUNC(int) PyRun_InteractiveOneObject( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     PyObject *filename, | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(int) PyRun_InteractiveLoopFlags( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PyAPI_FUNC(struct _mod *) PyParser_ASTFromString( | 
					
						
							|  |  |  |     const char *s, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int start, | 
					
						
							|  |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     PyArena *arena); | 
					
						
							| 
									
										
										
										
											2013-08-26 22:28:21 +02:00
										 |  |  | PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject( | 
					
						
							|  |  |  |     const char *s, | 
					
						
							|  |  |  |     PyObject *filename, | 
					
						
							|  |  |  |     int start, | 
					
						
							|  |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     PyArena *arena); | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     const char* enc, | 
					
						
							|  |  |  |     int start, | 
					
						
							| 
									
										
										
										
											2015-12-25 20:01:53 +02:00
										 |  |  |     const char *ps1, | 
					
						
							|  |  |  |     const char *ps2, | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     int *errcode, | 
					
						
							|  |  |  |     PyArena *arena); | 
					
						
							| 
									
										
										
										
											2013-08-26 22:28:21 +02:00
										 |  |  | PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     PyObject *filename, | 
					
						
							|  |  |  |     const char* enc, | 
					
						
							|  |  |  |     int start, | 
					
						
							| 
									
										
										
										
											2015-12-25 20:01:53 +02:00
										 |  |  |     const char *ps1, | 
					
						
							|  |  |  |     const char *ps2, | 
					
						
							| 
									
										
										
										
											2013-08-26 22:28:21 +02:00
										 |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     int *errcode, | 
					
						
							|  |  |  |     PyArena *arena); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef PyParser_SimpleParseString
 | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyParser_SimpleParseString(S, B) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyParser_SimpleParseStringFlags(S, B, 0) | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyParser_SimpleParseFile(FP, S, B) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyParser_SimpleParseFileFlags(FP, S, B, 0) | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  | PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, | 
					
						
							| 
									
										
										
										
											2012-06-03 08:07:47 +03:00
										 |  |  |                                                            int); | 
					
						
							| 
									
										
										
										
											2016-12-27 14:57:39 +02:00
										 |  |  | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
 | 
					
						
							| 
									
										
										
										
											2012-06-03 08:07:47 +03:00
										 |  |  | PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *, | 
					
						
							|  |  |  |                                                                    const char *, | 
					
						
							|  |  |  |                                                                    int, int); | 
					
						
							| 
									
										
										
										
											2016-12-27 14:57:39 +02:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2002-12-11 14:04:59 +00:00
										 |  |  | PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, | 
					
						
							| 
									
										
										
										
											2012-06-03 08:07:47 +03:00
										 |  |  |                                                          int, int); | 
					
						
							| 
									
										
										
										
											1990-12-20 15:06:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  | PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, | 
					
						
							|  |  |  |                                          PyObject *, PyCompilerFlags *); | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(PyObject *) PyRun_FileExFlags( | 
					
						
							|  |  |  |     FILE *fp, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int start, | 
					
						
							|  |  |  |     PyObject *globals, | 
					
						
							|  |  |  |     PyObject *locals, | 
					
						
							|  |  |  |     int closeit, | 
					
						
							|  |  |  |     PyCompilerFlags *flags); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifdef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2010-12-04 12:00:49 +00:00
										 |  |  | PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2010-12-04 10:26:46 +00:00
										 |  |  | #define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
 | 
					
						
							|  |  |  | #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
 | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(PyObject *) Py_CompileStringExFlags( | 
					
						
							|  |  |  |     const char *str, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int start, | 
					
						
							|  |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     int optimize); | 
					
						
							| 
									
										
										
										
											2013-08-26 22:28:21 +02:00
										 |  |  | PyAPI_FUNC(PyObject *) Py_CompileStringObject( | 
					
						
							|  |  |  |     const char *str, | 
					
						
							|  |  |  |     PyObject *filename, int start, | 
					
						
							|  |  |  |     PyCompilerFlags *flags, | 
					
						
							|  |  |  |     int optimize); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-12-27 01:49:31 +00:00
										 |  |  | PyAPI_FUNC(struct symtable *) Py_SymtableString( | 
					
						
							|  |  |  |     const char *str, | 
					
						
							|  |  |  |     const char *filename,       /* decoded from the filesystem encoding */ | 
					
						
							|  |  |  |     int start); | 
					
						
							| 
									
										
										
										
											2014-01-03 21:36:49 +01:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2013-08-26 22:28:21 +02:00
										 |  |  | PyAPI_FUNC(struct symtable *) Py_SymtableStringObject( | 
					
						
							|  |  |  |     const char *str, | 
					
						
							|  |  |  |     PyObject *filename, | 
					
						
							|  |  |  |     int start); | 
					
						
							| 
									
										
										
										
											2014-01-03 21:36:49 +01:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											1993-03-30 17:46:03 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-08-12 07:21:58 +00:00
										 |  |  | PyAPI_FUNC(void) PyErr_Print(void); | 
					
						
							|  |  |  | PyAPI_FUNC(void) PyErr_PrintEx(int); | 
					
						
							|  |  |  | PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); | 
					
						
							| 
									
										
										
										
											1990-12-20 15:06:42 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | /* Use macros for a bunch of old variants */ | 
					
						
							|  |  |  | #define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
 | 
					
						
							|  |  |  | #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
 | 
					
						
							|  |  |  | #define PyRun_AnyFileEx(fp, name, closeit) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyRun_AnyFileExFlags(fp, name, closeit, NULL) | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyRun_AnyFileFlags(fp, name, flags) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyRun_AnyFileExFlags(fp, name, 0, flags) | 
					
						
							| 
									
										
										
										
											2005-10-23 10:53:06 +00:00
										 |  |  | #define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL)
 | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL)
 | 
					
						
							|  |  |  | #define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL)
 | 
					
						
							|  |  |  | #define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL)
 | 
					
						
							|  |  |  | #define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL)
 | 
					
						
							|  |  |  | #define PyRun_File(fp, p, s, g, l) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyRun_FileExFlags(fp, p, s, g, l, 0, NULL) | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyRun_FileEx(fp, p, s, g, l, c) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyRun_FileExFlags(fp, p, s, g, l, c, NULL) | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | #define PyRun_FileFlags(fp, p, s, g, l, flags) \
 | 
					
						
							| 
									
										
										
										
											2010-05-09 15:52:27 +00:00
										 |  |  |     PyRun_FileExFlags(fp, p, s, g, l, 0, flags) | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2005-10-20 19:59:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1997-08-12 15:14:22 +00:00
										 |  |  | /* Stuff with no proper home (yet) */ | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2013-10-19 21:03:34 +03:00
										 |  |  | PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2002-08-12 13:06:35 +00:00
										 |  |  | PyAPI_DATA(int) (*PyOS_InputHook)(void); | 
					
						
							| 
									
										
										
										
											2013-10-19 21:03:34 +03:00
										 |  |  | PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #ifndef Py_LIMITED_API
 | 
					
						
							| 
									
										
										
										
											2004-08-09 15:02:30 +00:00
										 |  |  | PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; | 
					
						
							| 
									
										
										
										
											2010-12-03 20:14:31 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2000-08-27 19:15:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* Stack size, in "pointers" (so we get extra safety margins
 | 
					
						
							|  |  |  |    on 64-bit platforms).  On a 32-bit platform, this translates | 
					
						
							| 
									
										
										
										
											2016-05-08 13:53:41 +00:00
										 |  |  |    to an 8k margin. */ | 
					
						
							| 
									
										
										
										
											2000-08-27 19:15:31 +00:00
										 |  |  | #define PYOS_STACK_MARGIN 2048
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-13 01:09:34 +00:00
										 |  |  | #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300
 | 
					
						
							| 
									
										
										
										
											2000-08-27 19:15:31 +00:00
										 |  |  | /* Enable stack checking under Microsoft C */ | 
					
						
							|  |  |  | #define USE_STACKCHECK
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2000-08-07 21:00:42 +00:00
										 |  |  | #ifdef USE_STACKCHECK
 | 
					
						
							| 
									
										
										
										
											2000-08-27 19:15:31 +00:00
										 |  |  | /* Check that we aren't overflowing our stack */ | 
					
						
							| 
									
										
										
										
											2002-08-12 07:21:58 +00:00
										 |  |  | PyAPI_FUNC(int) PyOS_CheckStack(void); | 
					
						
							| 
									
										
										
										
											2000-08-07 21:00:42 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											1997-08-12 15:14:22 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											1993-07-28 09:05:47 +00:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #endif /* !Py_PYTHONRUN_H */
 |