Debian Codegraph @

pypy/module/cpyext/include/pythonrun.h

raw symbols SCIP
1 /* Interfaces to parse and execute pieces of python code */
2
3 #ifndef Py_PYTHONRUN_H
4 #define Py_PYTHONRUN_H
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 /* taken from Python-3.2.3/Include/pydebug.h */
10 /* Note: they are always 0 for now, except Py_DebugFlag which is always 1 */
11 PyAPI_DATA(int) Py_DebugFlag;
12 PyAPI_DATA(int) Py_VerboseFlag;
13 PyAPI_DATA(int) Py_QuietFlag;
14 PyAPI_DATA(int) Py_InteractiveFlag;
15 PyAPI_DATA(int) Py_InspectFlag;
16 PyAPI_DATA(int) Py_OptimizeFlag;
17 PyAPI_DATA(int) Py_NoSiteFlag;
18 PyAPI_DATA(int) Py_BytesWarningFlag;
19 PyAPI_DATA(int) Py_FrozenFlag; /* set when the python is "frozen" */
20 PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
21 PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
22 PyAPI_DATA(int) Py_NoUserSiteDirectory;
23 PyAPI_DATA(int) Py_UnbufferedStdioFlag;
24 PyAPI_DATA(int) Py_HashRandomizationFlag;
25 PyAPI_DATA(int) Py_IsolatedFlag;
26
27 #ifdef _WIN32
28 PyAPI_DATA(int) Py_LegacyWindowsStdioFlag;
29 #endif
30
31 #define Py_GETENV(s) (Py_IgnoreEnvironmentFlag ? NULL : getenv(s))
32
33
34 typedef struct {
35 int cf_flags; /* bitmask of CO_xxx flags relevant to future */
36 int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */
37 } PyCompilerFlags;
38
39 #define _PyCompilerFlags_INIT \
40 (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION}
41
42 #define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \
43 CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \
44 CO_FUTURE_UNICODE_LITERALS)
45 #define PyCF_MASK_OBSOLETE (CO_NESTED)
46 #define PyCF_SOURCE_IS_UTF8 0x0100
47 #define PyCF_DONT_IMPLY_DEDENT 0x0200
48 #define PyCF_ONLY_AST 0x0400
49
50 #define Py_CompileString(str, filename, start) Py_CompileStringFlags(str, filename, start, NULL)
51
52 /* Stuff with no proper home (yet) */
53 PyAPI_DATA(int) (*PyOS_InputHook)(void);
54 typedef int (*_pypy_pyos_inputhook)(void);
55 PyAPI_FUNC(_pypy_pyos_inputhook) _PyPy_get_PyOS_InputHook(void);
56
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif /* !Py_PYTHONRUN_H */