2018-11-01 02:15:58 +00:00
|
|
|
#ifndef Py_INTERNAL_LIFECYCLE_H
|
|
|
|
#define Py_INTERNAL_LIFECYCLE_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-04-17 21:02:26 +00:00
|
|
|
#ifndef Py_BUILD_CORE
|
|
|
|
# error "this header requires Py_BUILD_CORE define"
|
2018-11-01 02:15:58 +00:00
|
|
|
#endif
|
|
|
|
|
2021-03-10 19:00:46 +00:00
|
|
|
#include "pycore_runtime.h" // _PyRuntimeState
|
|
|
|
|
2019-10-02 21:51:20 +00:00
|
|
|
/* Forward declarations */
|
2019-10-04 00:21:05 +00:00
|
|
|
struct _PyArgv;
|
|
|
|
struct pyruntimestate;
|
2019-04-24 15:24:01 +00:00
|
|
|
|
2019-02-16 20:57:40 +00:00
|
|
|
/* True if the main interpreter thread exited due to an unhandled
|
|
|
|
* KeyboardInterrupt exception, suggesting the user pressed ^C. */
|
|
|
|
PyAPI_DATA(int) _Py_UnhandledKeyboardInterrupt;
|
|
|
|
|
2019-05-02 15:54:20 +00:00
|
|
|
extern int _Py_SetFileSystemEncoding(
|
2018-11-01 02:15:58 +00:00
|
|
|
const char *encoding,
|
|
|
|
const char *errors);
|
2019-05-02 15:54:20 +00:00
|
|
|
extern void _Py_ClearFileSystemEncoding(void);
|
2019-06-19 22:05:23 +00:00
|
|
|
extern PyStatus _PyUnicode_InitEncodings(PyThreadState *tstate);
|
2019-05-02 18:56:30 +00:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void);
|
|
|
|
#endif
|
2018-11-01 02:15:58 +00:00
|
|
|
|
|
|
|
PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void);
|
|
|
|
|
|
|
|
PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
|
|
|
|
|
2019-01-22 16:39:03 +00:00
|
|
|
/* Various one-time initializers */
|
|
|
|
|
2019-05-27 14:39:22 +00:00
|
|
|
extern PyStatus _PyFaulthandler_Init(int enable);
|
2018-11-01 02:15:58 +00:00
|
|
|
extern int _PyTraceMalloc_Init(int enable);
|
2021-02-19 14:10:45 +00:00
|
|
|
extern PyObject * _PyBuiltin_Init(PyInterpreterState *interp);
|
2019-05-27 14:39:22 +00:00
|
|
|
extern PyStatus _PySys_Create(
|
2019-06-19 22:05:23 +00:00
|
|
|
PyThreadState *tstate,
|
2019-01-23 14:04:40 +00:00
|
|
|
PyObject **sysmod_p);
|
2019-09-29 23:40:17 +00:00
|
|
|
extern PyStatus _PySys_ReadPreinitWarnOptions(PyWideStringList *options);
|
2019-08-23 17:03:08 +00:00
|
|
|
extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config);
|
2020-11-04 16:34:34 +00:00
|
|
|
extern int _PySys_UpdateConfig(PyThreadState *tstate);
|
2022-01-21 00:42:25 +00:00
|
|
|
extern void _PySys_Fini(PyInterpreterState *interp);
|
2022-01-22 20:48:56 +00:00
|
|
|
extern int _PyBuiltins_AddExceptions(PyObject * bltinmod);
|
2019-05-27 14:39:22 +00:00
|
|
|
extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
|
2018-11-01 02:15:58 +00:00
|
|
|
|
2019-06-19 00:54:39 +00:00
|
|
|
extern PyStatus _PyImportZip_Init(PyThreadState *tstate);
|
2021-02-19 14:10:45 +00:00
|
|
|
extern PyStatus _PyGC_Init(PyInterpreterState *interp);
|
|
|
|
extern PyStatus _PyAtExit_Init(PyInterpreterState *interp);
|
2022-02-26 16:35:03 +00:00
|
|
|
extern int _Py_Deepfreeze_Init(void);
|
2018-11-01 02:15:58 +00:00
|
|
|
|
2019-01-22 16:39:03 +00:00
|
|
|
/* Various internal finalizers */
|
|
|
|
|
2020-11-17 15:22:23 +00:00
|
|
|
extern int _PySignal_Init(int install_signal_handlers);
|
|
|
|
extern void _PySignal_Fini(void);
|
2019-01-22 16:39:03 +00:00
|
|
|
|
|
|
|
extern void _PyImport_Fini(void);
|
|
|
|
extern void _PyImport_Fini2(void);
|
2021-02-19 14:10:45 +00:00
|
|
|
extern void _PyGC_Fini(PyInterpreterState *interp);
|
2019-01-22 16:39:03 +00:00
|
|
|
extern void _Py_HashRandomization_Fini(void);
|
2018-11-01 02:15:58 +00:00
|
|
|
extern void _PyFaulthandler_Fini(void);
|
|
|
|
extern void _PyHash_Fini(void);
|
2019-09-18 12:39:20 +00:00
|
|
|
extern void _PyTraceMalloc_Fini(void);
|
2019-05-10 17:29:55 +00:00
|
|
|
extern void _PyWarnings_Fini(PyInterpreterState *interp);
|
2020-11-03 17:07:15 +00:00
|
|
|
extern void _PyAST_Fini(PyInterpreterState *interp);
|
2020-12-15 13:34:19 +00:00
|
|
|
extern void _PyAtExit_Fini(PyInterpreterState *interp);
|
2022-01-21 00:42:25 +00:00
|
|
|
extern void _PyThread_FiniType(PyInterpreterState *interp);
|
2022-01-27 13:03:47 +00:00
|
|
|
extern void _Py_Deepfreeze_Fini(void);
|
2022-02-25 15:19:30 +00:00
|
|
|
extern void _PyArg_Fini(void);
|
2018-11-01 02:15:58 +00:00
|
|
|
|
2021-03-10 19:00:46 +00:00
|
|
|
extern PyStatus _PyGILState_Init(_PyRuntimeState *runtime);
|
|
|
|
extern PyStatus _PyGILState_SetTstate(PyThreadState *tstate);
|
2021-02-19 14:10:45 +00:00
|
|
|
extern void _PyGILState_Fini(PyInterpreterState *interp);
|
2018-11-01 02:15:58 +00:00
|
|
|
|
2021-02-19 14:10:45 +00:00
|
|
|
PyAPI_FUNC(void) _PyGC_DumpShutdownStats(PyInterpreterState *interp);
|
2018-11-01 02:15:58 +00:00
|
|
|
|
2019-05-27 14:39:22 +00:00
|
|
|
PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv(
|
|
|
|
const PyPreConfig *src_config,
|
2019-10-04 00:21:05 +00:00
|
|
|
const struct _PyArgv *args);
|
2019-05-27 14:39:22 +00:00
|
|
|
PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig(
|
|
|
|
const PyConfig *config,
|
2019-10-04 00:21:05 +00:00
|
|
|
const struct _PyArgv *args);
|
2019-03-26 01:31:11 +00:00
|
|
|
|
2021-09-28 18:18:28 +00:00
|
|
|
PyAPI_FUNC(wchar_t *) _Py_GetStdlibDir(void);
|
2019-05-22 09:28:22 +00:00
|
|
|
|
2019-05-17 21:05:29 +00:00
|
|
|
PyAPI_FUNC(int) _Py_HandleSystemExit(int *exitcode_p);
|
|
|
|
|
2019-05-22 09:28:22 +00:00
|
|
|
PyAPI_FUNC(PyObject*) _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable);
|
|
|
|
|
2019-05-24 15:01:38 +00:00
|
|
|
PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate);
|
2019-05-27 22:39:52 +00:00
|
|
|
PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception,
|
|
|
|
PyObject *value, PyObject *tb);
|
2019-05-24 15:01:38 +00:00
|
|
|
|
2020-03-18 01:26:04 +00:00
|
|
|
PyAPI_FUNC(void) _PyThreadState_DeleteCurrent(PyThreadState *tstate);
|
2019-09-05 16:06:49 +00:00
|
|
|
|
2021-02-19 14:10:45 +00:00
|
|
|
extern void _PyAtExit_Call(PyInterpreterState *interp);
|
2020-12-14 22:07:54 +00:00
|
|
|
|
2018-11-01 02:15:58 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_INTERNAL_LIFECYCLE_H */
|