| Nick Coghlan | d600951 | 2014-11-20 21:39:37 +1000 | [diff] [blame] | 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 | PyAPI_FUNC(void) Py_SetProgramName(wchar_t *); | 
 | 11 | PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); | 
 | 12 |  | 
 | 13 | PyAPI_FUNC(void) Py_SetPythonHome(wchar_t *); | 
 | 14 | PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void); | 
 | 15 |  | 
 | 16 | #ifndef Py_LIMITED_API | 
 | 17 | /* Only used by applications that embed the interpreter and need to | 
 | 18 |  * override the standard encoding determination mechanism | 
 | 19 |  */ | 
 | 20 | PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding, | 
 | 21 |                                              const char *errors); | 
 | 22 | #endif | 
 | 23 |  | 
 | 24 | PyAPI_FUNC(void) Py_Initialize(void); | 
 | 25 | PyAPI_FUNC(void) Py_InitializeEx(int); | 
 | 26 | #ifndef Py_LIMITED_API | 
 | 27 | PyAPI_FUNC(void) _Py_InitializeEx_Private(int, int); | 
 | 28 | #endif | 
 | 29 | PyAPI_FUNC(void) Py_Finalize(void); | 
| Martin Panter | b4ce1fc | 2015-11-30 03:18:29 +0000 | [diff] [blame] | 30 | PyAPI_FUNC(int) Py_FinalizeEx(void); | 
| Nick Coghlan | d600951 | 2014-11-20 21:39:37 +1000 | [diff] [blame] | 31 | PyAPI_FUNC(int) Py_IsInitialized(void); | 
 | 32 | PyAPI_FUNC(PyThreadState *) Py_NewInterpreter(void); | 
 | 33 | PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *); | 
 | 34 |  | 
 | 35 |  | 
 | 36 | /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level | 
 | 37 |  * exit functions. | 
 | 38 |  */ | 
 | 39 | #ifndef Py_LIMITED_API | 
 | 40 | PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void)); | 
 | 41 | #endif | 
 | 42 | PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); | 
 | 43 |  | 
 | 44 | PyAPI_FUNC(void) Py_Exit(int); | 
 | 45 |  | 
 | 46 | /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ | 
 | 47 | #ifndef Py_LIMITED_API | 
 | 48 | PyAPI_FUNC(void) _Py_RestoreSignals(void); | 
 | 49 |  | 
 | 50 | PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *); | 
 | 51 | #endif | 
 | 52 |  | 
 | 53 | /* Bootstrap __main__ (defined in Modules/main.c) */ | 
 | 54 | PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); | 
 | 55 |  | 
 | 56 | /* In getpath.c */ | 
 | 57 | PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void); | 
 | 58 | PyAPI_FUNC(wchar_t *) Py_GetPrefix(void); | 
 | 59 | PyAPI_FUNC(wchar_t *) Py_GetExecPrefix(void); | 
 | 60 | PyAPI_FUNC(wchar_t *) Py_GetPath(void); | 
 | 61 | PyAPI_FUNC(void)      Py_SetPath(const wchar_t *); | 
 | 62 | #ifdef MS_WINDOWS | 
 | 63 | int _Py_CheckPython3(); | 
 | 64 | #endif | 
 | 65 |  | 
 | 66 | /* In their own files */ | 
 | 67 | PyAPI_FUNC(const char *) Py_GetVersion(void); | 
 | 68 | PyAPI_FUNC(const char *) Py_GetPlatform(void); | 
 | 69 | PyAPI_FUNC(const char *) Py_GetCopyright(void); | 
 | 70 | PyAPI_FUNC(const char *) Py_GetCompiler(void); | 
 | 71 | PyAPI_FUNC(const char *) Py_GetBuildInfo(void); | 
 | 72 | #ifndef Py_LIMITED_API | 
 | 73 | PyAPI_FUNC(const char *) _Py_hgidentifier(void); | 
 | 74 | PyAPI_FUNC(const char *) _Py_hgversion(void); | 
 | 75 | #endif | 
 | 76 |  | 
 | 77 | /* Internal -- various one-time initializations */ | 
 | 78 | #ifndef Py_LIMITED_API | 
 | 79 | PyAPI_FUNC(PyObject *) _PyBuiltin_Init(void); | 
 | 80 | PyAPI_FUNC(PyObject *) _PySys_Init(void); | 
 | 81 | PyAPI_FUNC(void) _PyImport_Init(void); | 
 | 82 | PyAPI_FUNC(void) _PyExc_Init(PyObject * bltinmod); | 
 | 83 | PyAPI_FUNC(void) _PyImportHooks_Init(void); | 
 | 84 | PyAPI_FUNC(int) _PyFrame_Init(void); | 
 | 85 | PyAPI_FUNC(int) _PyFloat_Init(void); | 
 | 86 | PyAPI_FUNC(int) PyByteArray_Init(void); | 
 | 87 | PyAPI_FUNC(void) _PyRandom_Init(void); | 
 | 88 | #endif | 
 | 89 |  | 
 | 90 | /* Various internal finalizers */ | 
 | 91 | #ifndef Py_LIMITED_API | 
 | 92 | PyAPI_FUNC(void) _PyExc_Fini(void); | 
 | 93 | PyAPI_FUNC(void) _PyImport_Fini(void); | 
 | 94 | PyAPI_FUNC(void) PyMethod_Fini(void); | 
 | 95 | PyAPI_FUNC(void) PyFrame_Fini(void); | 
 | 96 | PyAPI_FUNC(void) PyCFunction_Fini(void); | 
 | 97 | PyAPI_FUNC(void) PyDict_Fini(void); | 
 | 98 | PyAPI_FUNC(void) PyTuple_Fini(void); | 
 | 99 | PyAPI_FUNC(void) PyList_Fini(void); | 
 | 100 | PyAPI_FUNC(void) PySet_Fini(void); | 
 | 101 | PyAPI_FUNC(void) PyBytes_Fini(void); | 
 | 102 | PyAPI_FUNC(void) PyByteArray_Fini(void); | 
 | 103 | PyAPI_FUNC(void) PyFloat_Fini(void); | 
 | 104 | PyAPI_FUNC(void) PyOS_FiniInterrupts(void); | 
 | 105 | PyAPI_FUNC(void) _PyGC_DumpShutdownStats(void); | 
 | 106 | PyAPI_FUNC(void) _PyGC_Fini(void); | 
 | 107 | PyAPI_FUNC(void) PySlice_Fini(void); | 
 | 108 | PyAPI_FUNC(void) _PyType_Fini(void); | 
 | 109 | PyAPI_FUNC(void) _PyRandom_Fini(void); | 
 | 110 |  | 
 | 111 | PyAPI_DATA(PyThreadState *) _Py_Finalizing; | 
 | 112 | #endif | 
 | 113 |  | 
 | 114 | /* Signals */ | 
 | 115 | typedef void (*PyOS_sighandler_t)(int); | 
 | 116 | PyAPI_FUNC(PyOS_sighandler_t) PyOS_getsig(int); | 
 | 117 | PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t); | 
 | 118 |  | 
 | 119 | /* Random */ | 
 | 120 | PyAPI_FUNC(int) _PyOS_URandom (void *buffer, Py_ssize_t size); | 
 | 121 |  | 
 | 122 | #ifdef __cplusplus | 
 | 123 | } | 
 | 124 | #endif | 
 | 125 | #endif /* !Py_PYLIFECYCLE_H */ |