blob: b0a2fc3002d37d042d4fbb42e87ca7ef16a9dbb7 [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);
Fredrik Lundh2f15b252000-08-27 19:15:31 +000019
20/* Stack size, in "pointers" (so we get extra safety margins
21 on 64-bit platforms). On a 32-bit platform, this translates
Martin Panter4c359642016-05-08 13:53:41 +000022 to an 8k margin. */
Fredrik Lundh2f15b252000-08-27 19:15:31 +000023#define PYOS_STACK_MARGIN 2048
24
Paul Monson11efd792019-04-17 18:09:16 -070025#if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
Fredrik Lundh2f15b252000-08-27 19:15:31 +000026/* Enable stack checking under Microsoft C */
27#define USE_STACKCHECK
28#endif
29
Jack Jansen275abb32000-08-07 21:00:42 +000030#ifdef USE_STACKCHECK
Fredrik Lundh2f15b252000-08-27 19:15:31 +000031/* Check that we aren't overflowing our stack */
Mark Hammond91a681d2002-08-12 07:21:58 +000032PyAPI_FUNC(int) PyOS_CheckStack(void);
Jack Jansen275abb32000-08-07 21:00:42 +000033#endif
Guido van Rossum3fb1aea1997-08-12 15:14:22 +000034
Victor Stinnerfe6e5e72020-12-08 23:51:54 +010035#ifndef Py_LIMITED_API
36# define Py_CPYTHON_PYTHONRUN_H
37# include "cpython/pythonrun.h"
38# undef Py_CPYTHON_PYTHONRUN_H
39#endif
40
Guido van Rossuma3309961993-07-28 09:05:47 +000041#ifdef __cplusplus
42}
43#endif
44#endif /* !Py_PYTHONRUN_H */