File indexing completed on 2025-01-18 10:06:46
0001 #ifndef Py_INTERNAL_LIFECYCLE_H
0002 #define Py_INTERNAL_LIFECYCLE_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006
0007 #ifndef Py_BUILD_CORE
0008 # error "this header requires Py_BUILD_CORE define"
0009 #endif
0010
0011 #include "pycore_runtime.h" // _PyRuntimeState
0012
0013
0014 struct _PyArgv;
0015 struct pyruntimestate;
0016
0017 extern int _Py_SetFileSystemEncoding(
0018 const char *encoding,
0019 const char *errors);
0020 extern void _Py_ClearFileSystemEncoding(void);
0021 extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate);
0022 #ifdef MS_WINDOWS
0023 extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void);
0024 #endif
0025
0026 PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void);
0027
0028 PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
0029
0030
0031
0032 extern void _Py_InitVersion(void);
0033 extern PyStatus _PyFaulthandler_Init(int enable);
0034 extern PyObject * _PyBuiltin_Init(PyInterpreterState *interp);
0035 extern PyStatus _PySys_Create(
0036 PyThreadState *tstate,
0037 PyObject **sysmod_p);
0038 extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options);
0039 extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config);
0040 extern int _PySys_UpdateConfig(PyThreadState *tstate);
0041 extern void _PySys_FiniTypes(PyInterpreterState *interp);
0042 extern int _PyBuiltins_AddExceptions(PyObject * bltinmod);
0043 extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
0044
0045 extern PyStatus _PyTime_Init(void);
0046 extern PyStatus _PyGC_Init(PyInterpreterState *interp);
0047 extern PyStatus _PyAtExit_Init(PyInterpreterState *interp);
0048 extern int _Py_Deepfreeze_Init(void);
0049
0050
0051
0052 extern int _PySignal_Init(int install_signal_handlers);
0053 extern void _PySignal_Fini(void);
0054
0055 extern void _PyGC_Fini(PyInterpreterState *interp);
0056 extern void _Py_HashRandomization_Fini(void);
0057 extern void _PyFaulthandler_Fini(void);
0058 extern void _PyHash_Fini(void);
0059 extern void _PyTraceMalloc_Fini(void);
0060 extern void _PyWarnings_Fini(PyInterpreterState *interp);
0061 extern void _PyAST_Fini(PyInterpreterState *interp);
0062 extern void _PyAtExit_Fini(PyInterpreterState *interp);
0063 extern void _PyThread_FiniType(PyInterpreterState *interp);
0064 extern void _Py_Deepfreeze_Fini(void);
0065 extern void _PyArg_Fini(void);
0066 extern void _Py_FinalizeAllocatedBlocks(_PyRuntimeState *);
0067
0068 extern PyStatus _PyGILState_Init(PyInterpreterState *interp);
0069 extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate);
0070 extern void _PyGILState_Fini(PyInterpreterState *interp);
0071
0072 PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyInterpreterState *interp);
0073
0074 PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv(
0075 const PyPreConfig *src_config,
0076 const struct _PyArgv *args);
0077 PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig(
0078 const PyConfig *config,
0079 const struct _PyArgv *args);
0080
0081 PyAPI_FUNC(wchar_t *) _Py_GetStdlibDir(void);
0082
0083 PyAPI_FUNC(int) _Py_HandleSystemExit(int *exitcode_p);
0084
0085 PyAPI_FUNC(PyObject*) _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable);
0086
0087 PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate);
0088 PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception,
0089 PyObject *value, PyObject *tb);
0090 PyAPI_FUNC(void) _PyErr_DisplayException(PyObject *file, PyObject *exc);
0091
0092 PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate);
0093
0094 extern void _PyAtExit_Call(PyInterpreterState *interp);
0095
0096 #ifdef __cplusplus
0097 }
0098 #endif
0099 #endif