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