• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7 extern "C" {
8 #endif
9 
10 
11 /* Initialization and finalization */
12 PyAPI_FUNC(void) Py_Initialize(void);
13 PyAPI_FUNC(void) Py_InitializeEx(int);
14 PyAPI_FUNC(void) Py_Finalize(void);
15 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
16 PyAPI_FUNC(int) Py_FinalizeEx(void);
17 #endif
18 PyAPI_FUNC(int) Py_IsInitialized(void);
19 
20 /* Subinterpreter support */
21 PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void);
22 PyAPI_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  */
28 PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
29 
30 PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
31 
32 /* Bootstrap __main__ (defined in Modules/main.c) */
33 PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
34 PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
35 
36 /* In pathconfig.c */
37 PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
38 PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
39 
40 PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
41 PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
42 
43 PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
44 
45 PyAPI_FUNC(wchar_t *) Py_GetPrefix(void);
46 PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void);
47 PyAPI_FUNC(wchar_t *) Py_GetPath(void);
48 PyAPI_FUNC(void)      Py_SetPath(const wchar_t *);
49 #ifdef MS_WINDOWS
50 int _Py_CheckPython3(void);
51 #endif
52 
53 /* In their own files */
54 PyAPI_FUNC(const char *) Py_GetVersion(void);
55 PyAPI_FUNC(const char *) Py_GetPlatform(void);
56 PyAPI_FUNC(const char *) Py_GetCopyright(void);
57 PyAPI_FUNC(const char *) Py_GetCompiler(void);
58 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
59 
60 /* Signals */
61 typedef void (*PyOS_sighandler_t)(int);
62 PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int);
63 PyAPI_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