1
2/* Interfaces to configure, query, create & destroy the Python runtime */
3
4#ifndef Py_PYLIFECYCLE_H
5#define Py_PYLIFECYCLE_H
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10
11/* Initialization and finalization */
12PyAPI_FUNC(void) Py_Initialize(void);
13PyAPI_FUNC(void) Py_InitializeEx(int);
14PyAPI_FUNC(void) Py_Finalize(void);
15#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
16PyAPI_FUNC(int) Py_FinalizeEx(void);
17#endif
18PyAPI_FUNC(int) Py_IsInitialized(void);
19
20/* Subinterpreter support */
21PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
22PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
23
24
25/* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
26 * exit functions.
27 */
28PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
29
30PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
31
32/* Bootstrap __main__ (defined in Modules/main.c) */
33PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
34PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
35
36/* In pathconfig.c */
37PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
38PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
39
40PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
41PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
42
43PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
44
45PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
46PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
47PyAPI_FUNC(wchar_t *) Py_GetPath(void);
48PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
49#ifdef MS_WINDOWS
50int _Py_CheckPython3(void);
51#endif
52
53/* In their own files */
54PyAPI_FUNC(const char *) Py_GetVersion(void);
55PyAPI_FUNC(const char *) Py_GetPlatform(void);
56PyAPI_FUNC(const char *) Py_GetCopyright(void);
57PyAPI_FUNC(const char *) Py_GetCompiler(void);
58PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
59
60/* Signals */
61typedef void (*PyOS_sighandler_t)(int);
62PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
63PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
64
65#ifndef Py_LIMITED_API
66# define Py_CPYTHON_PYLIFECYCLE_H
67# include "cpython/pylifecycle.h"
68# undef Py_CPYTHON_PYLIFECYCLE_H
69#endif
70
71#ifdef __cplusplus
72}
73#endif
74#endif /* !Py_PYLIFECYCLE_H */
75

source code of include/python3.10/pylifecycle.h