2014-11-20 11:39:37 +00:00
|
|
|
|
|
|
|
/* Interfaces to configure, query, create & destroy the Python runtime */
|
|
|
|
|
|
|
|
#ifndef Py_PYLIFECYCLE_H
|
|
|
|
#define Py_PYLIFECYCLE_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2017-05-24 04:46:51 +00:00
|
|
|
/* Initialization and finalization */
|
2014-11-20 11:39:37 +00:00
|
|
|
PyAPI_FUNC(void) Py_Initialize(void);
|
|
|
|
PyAPI_FUNC(void) Py_InitializeEx(int);
|
|
|
|
PyAPI_FUNC(void) Py_Finalize(void);
|
2018-12-20 21:11:03 +00:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
|
2015-11-30 03:18:29 +00:00
|
|
|
PyAPI_FUNC(int) Py_FinalizeEx(void);
|
2018-12-20 21:11:03 +00:00
|
|
|
#endif
|
2014-11-20 11:39:37 +00:00
|
|
|
PyAPI_FUNC(int) Py_IsInitialized(void);
|
2017-05-24 04:46:51 +00:00
|
|
|
|
|
|
|
/* Subinterpreter support */
|
2014-11-20 11:39:37 +00:00
|
|
|
PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
|
|
|
|
PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
|
|
|
|
|
|
|
|
|
|
|
|
/* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
|
|
|
|
* exit functions.
|
|
|
|
*/
|
|
|
|
PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
|
|
|
|
|
2018-08-01 14:41:25 +00:00
|
|
|
PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
|
2014-11-20 11:39:37 +00:00
|
|
|
|
|
|
|
/* Bootstrap __main__ (defined in Modules/main.c) */
|
|
|
|
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
|
2019-08-26 22:45:45 +00:00
|
|
|
PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
|
|
|
|
|
2018-11-18 04:41:48 +00:00
|
|
|
/* In pathconfig.c */
|
2024-04-18 13:20:38 +00:00
|
|
|
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
|
2023-06-01 12:06:32 +00:00
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
|
2024-04-18 13:20:38 +00:00
|
|
|
|
|
|
|
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
|
2023-06-01 12:06:32 +00:00
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
|
2024-04-18 13:20:38 +00:00
|
|
|
|
2023-06-01 12:06:32 +00:00
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
|
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
|
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
|
|
|
|
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPath(void);
|
2014-11-20 11:39:37 +00:00
|
|
|
#ifdef MS_WINDOWS
|
2017-12-04 12:39:15 +00:00
|
|
|
int _Py_CheckPython3(void);
|
2014-11-20 11:39:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* In their own files */
|
|
|
|
PyAPI_FUNC(const char *) Py_GetVersion(void);
|
|
|
|
PyAPI_FUNC(const char *) Py_GetPlatform(void);
|
|
|
|
PyAPI_FUNC(const char *) Py_GetCopyright(void);
|
|
|
|
PyAPI_FUNC(const char *) Py_GetCompiler(void);
|
|
|
|
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
|
|
|
|
|
|
|
|
/* Signals */
|
|
|
|
typedef void (*PyOS_sighandler_t)(int);
|
|
|
|
PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
|
|
|
|
PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);
|
|
|
|
|
2021-12-10 01:52:05 +00:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030B0000
|
|
|
|
PyAPI_DATA(const unsigned long) Py_Version;
|
|
|
|
#endif
|
|
|
|
|
2023-10-07 15:59:16 +00:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000
|
|
|
|
PyAPI_FUNC(int) Py_IsFinalizing(void);
|
|
|
|
#endif
|
|
|
|
|
2016-09-11 08:03:14 +00:00
|
|
|
#ifndef Py_LIMITED_API
|
2018-11-26 23:12:05 +00:00
|
|
|
# define Py_CPYTHON_PYLIFECYCLE_H
|
2021-10-14 23:50:04 +00:00
|
|
|
# include "cpython/pylifecycle.h"
|
2018-11-26 23:12:05 +00:00
|
|
|
# undef Py_CPYTHON_PYLIFECYCLE_H
|
2017-10-27 09:46:03 +00:00
|
|
|
#endif
|
|
|
|
|
2014-11-20 11:39:37 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_PYLIFECYCLE_H */
|