blob: b87bc738902420dc7924140df1573861eb0ccc15 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001
Guido van Rossum3f5da241990-12-20 15:06:42 +00002/* Interfaces to parse and execute pieces of python code */
3
Fred Drake3cf4d2b2000-07-09 00:55:06 +00004#ifndef Py_PYTHONRUN_H
5#define Py_PYTHONRUN_H
6#ifdef __cplusplus
7extern "C" {
8#endif
Guido van Rossum57d8e3f1997-07-19 19:50:52 +00009
Martin v. Löwis0d012f22010-12-04 12:00:49 +000010PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
Victor Stinnerfe6e5e72020-12-08 23:51:54 +010011
Mark Hammond91a681d2002-08-12 07:21:58 +000012PyAPI_FUNC(void) PyErr_Print(void);
13PyAPI_FUNC(void) PyErr_PrintEx(int);
14PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
Guido van Rossumc6cf1dd1994-09-07 14:35:10 +000015
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000016
Guido van Rossum3fb1aea1997-08-12 15:14:22 +000017/* Stuff with no proper home (yet) */
Mark Hammond5d546672002-08-12 13:06:35 +000018PyAPI_DATA(int) (*PyOS_InputHook)(void);
Serhiy Storchakac6792272013-10-19 21:03:34 +030019PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
Fredrik Lundh2f15b252000-08-27 19:15:31 +000020
21/* Stack size, in "pointers" (so we get extra safety margins
22 on 64-bit platforms). On a 32-bit platform, this translates
Martin Panter4c359642016-05-08 13:53:41 +000023 to an 8k margin. */
Fredrik Lundh2f15b252000-08-27 19:15:31 +000024#define PYOS_STACK_MARGIN 2048
25
Paul Monson11efd792019-04-17 18:09:16 -070026#if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
Fredrik Lundh2f15b252000-08-27 19:15:31 +000027/* Enable stack checking under Microsoft C */
28#define USE_STACKCHECK
29#endif
30
Jack Jansen275abb32000-08-07 21:00:42 +000031#ifdef USE_STACKCHECK
Fredrik Lundh2f15b252000-08-27 19:15:31 +000032/* Check that we aren't overflowing our stack */
Mark Hammond91a681d2002-08-12 07:21:58 +000033PyAPI_FUNC(int) PyOS_CheckStack(void);
Jack Jansen275abb32000-08-07 21:00:42 +000034#endif
Guido van Rossum3fb1aea1997-08-12 15:14:22 +000035
Victor Stinnerfe6e5e72020-12-08 23:51:54 +010036#ifndef Py_LIMITED_API
37# define Py_CPYTHON_PYTHONRUN_H
38# include "cpython/pythonrun.h"
39# undef Py_CPYTHON_PYTHONRUN_H
40#endif
41
Guido van Rossuma3309961993-07-28 09:05:47 +000042#ifdef __cplusplus
43}
44#endif
45#endif /* !Py_PYTHONRUN_H */