2014-11-20 19:39:37 +08: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 12:46:51 +08:00
|
|
|
/* Initialization and finalization */
|
2014-11-20 19:39:37 +08:00
|
|
|
PyAPI_FUNC(void) Py_Initialize(void);
|
|
|
|
PyAPI_FUNC(void) Py_InitializeEx(int);
|
|
|
|
PyAPI_FUNC(void) Py_Finalize(void);
|
2018-12-21 05:11:03 +08:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
|
2015-11-30 11:18:29 +08:00
|
|
|
PyAPI_FUNC(int) Py_FinalizeEx(void);
|
2018-12-21 05:11:03 +08:00
|
|
|
#endif
|
2014-11-20 19:39:37 +08:00
|
|
|
PyAPI_FUNC(int) Py_IsInitialized(void);
|
2017-05-24 12:46:51 +08:00
|
|
|
|
|
|
|
/* Subinterpreter support */
|
2014-11-20 19:39:37 +08: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 22:41:25 +08:00
|
|
|
PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
|
2014-11-20 19:39:37 +08:00
|
|
|
|
|
|
|
/* Bootstrap __main__ (defined in Modules/main.c) */
|
|
|
|
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
|
2019-08-27 06:45:45 +08:00
|
|
|
PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
|
|
|
|
|
2018-11-18 12:41:48 +08:00
|
|
|
/* In pathconfig.c */
|
2021-05-13 05:59:25 +08:00
|
|
|
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
|
2018-11-18 12:41:48 +08:00
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
|
|
|
|
|
2021-05-13 05:59:25 +08:00
|
|
|
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
|
2018-11-18 12:41:48 +08:00
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
|
|
|
|
|
2014-11-20 19:39:37 +08:00
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
|
2018-11-18 12:41:48 +08:00
|
|
|
|
2014-11-20 19:39:37 +08:00
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
|
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
|
|
|
|
PyAPI_FUNC(wchar_t *) Py_GetPath(void);
|
2021-05-13 05:59:25 +08:00
|
|
|
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPath(const wchar_t *);
|
2014-11-20 19:39:37 +08:00
|
|
|
#ifdef MS_WINDOWS
|
2017-12-04 20:39:15 +08:00
|
|
|
int _Py_CheckPython3(void);
|
2014-11-20 19:39:37 +08: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 09:52:05 +08:00
|
|
|
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030B0000
|
|
|
|
PyAPI_DATA(const unsigned long) Py_Version;
|
|
|
|
#endif
|
|
|
|
|
2016-09-11 16:03:14 +08:00
|
|
|
#ifndef Py_LIMITED_API
|
2018-11-27 07:12:05 +08:00
|
|
|
# define Py_CPYTHON_PYLIFECYCLE_H
|
2021-10-15 07:50:04 +08:00
|
|
|
# include "cpython/pylifecycle.h"
|
2018-11-27 07:12:05 +08:00
|
|
|
# undef Py_CPYTHON_PYLIFECYCLE_H
|
2017-10-27 17:46:03 +08:00
|
|
|
#endif
|
|
|
|
|
2014-11-20 19:39:37 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_PYLIFECYCLE_H */
|