blob: cc6c745a4d33d88fb319d7a8f8c6728530a7735a [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
Victor Stinner00676d12010-12-27 01:49:31 +000012PyAPI_FUNC(struct symtable *) Py_SymtableString(
13 const char *str,
14 const char *filename, /* decoded from the filesystem encoding */
15 int start);
Guido van Rossum3f5da241990-12-20 15:06:42 +000016
Mark Hammond91a681d2002-08-12 07:21:58 +000017PyAPI_FUNC(void) PyErr_Print(void);
18PyAPI_FUNC(void) PyErr_PrintEx(int);
19PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
Guido van Rossumc6cf1dd1994-09-07 14:35:10 +000020
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000021
Guido van Rossum3fb1aea1997-08-12 15:14:22 +000022/* Stuff with no proper home (yet) */
Mark Hammond5d546672002-08-12 13:06:35 +000023PyAPI_DATA(int) (*PyOS_InputHook)(void);
Serhiy Storchakac6792272013-10-19 21:03:34 +030024PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
Fredrik Lundh2f15b252000-08-27 19:15:31 +000025
26/* Stack size, in "pointers" (so we get extra safety margins
27 on 64-bit platforms). On a 32-bit platform, this translates
Martin Panter4c359642016-05-08 13:53:41 +000028 to an 8k margin. */
Fredrik Lundh2f15b252000-08-27 19:15:31 +000029#define PYOS_STACK_MARGIN 2048
30
Paul Monson11efd792019-04-17 18:09:16 -070031#if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
Fredrik Lundh2f15b252000-08-27 19:15:31 +000032/* Enable stack checking under Microsoft C */
33#define USE_STACKCHECK
34#endif
35
Jack Jansen275abb32000-08-07 21:00:42 +000036#ifdef USE_STACKCHECK
Fredrik Lundh2f15b252000-08-27 19:15:31 +000037/* Check that we aren't overflowing our stack */
Mark Hammond91a681d2002-08-12 07:21:58 +000038PyAPI_FUNC(int) PyOS_CheckStack(void);
Jack Jansen275abb32000-08-07 21:00:42 +000039#endif
Guido van Rossum3fb1aea1997-08-12 15:14:22 +000040
Victor Stinnerfe6e5e72020-12-08 23:51:54 +010041#ifndef Py_LIMITED_API
42# define Py_CPYTHON_PYTHONRUN_H
43# include "cpython/pythonrun.h"
44# undef Py_CPYTHON_PYTHONRUN_H
45#endif
46
Guido van Rossuma3309961993-07-28 09:05:47 +000047#ifdef __cplusplus
48}
49#endif
50#endif /* !Py_PYTHONRUN_H */