2018-10-31 23:15:58 -03:00
|
|
|
#ifndef Py_INTERNAL_LIFECYCLE_H
|
|
|
|
#define Py_INTERNAL_LIFECYCLE_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-04-17 18:02:26 -03:00
|
|
|
#ifndef Py_BUILD_CORE
|
|
|
|
# error "this header requires Py_BUILD_CORE define"
|
2018-10-31 23:15:58 -03:00
|
|
|
#endif
|
|
|
|
|
2019-05-27 11:39:22 -03:00
|
|
|
#include "pycore_initconfig.h" /* _PyArgv */
|
2019-05-02 16:25:34 -03:00
|
|
|
#include "pycore_pystate.h" /* _PyRuntimeState */
|
2019-04-24 12:24:01 -03:00
|
|
|
|
2019-02-16 16:57:40 -04: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-27 11:39:22 -03:00
|
|
|
PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-05-02 12:54:20 -03:00
|
|
|
extern int _Py_SetFileSystemEncoding(
|
2018-10-31 23:15:58 -03:00
|
|
|
const char *encoding,
|
|
|
|
const char *errors);
|
2019-05-02 12:54:20 -03:00
|
|
|
extern void _Py_ClearFileSystemEncoding(void);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PyUnicode_InitEncodings(PyInterpreterState *interp);
|
2019-05-02 15:56:30 -03:00
|
|
|
#ifdef MS_WINDOWS
|
|
|
|
extern int _PyUnicode_EnableLegacyWindowsFSEncoding(void);
|
|
|
|
#endif
|
2018-10-31 23:15:58 -03:00
|
|
|
|
|
|
|
PyAPI_FUNC(void) _Py_ClearStandardStreamEncoding(void);
|
|
|
|
|
|
|
|
PyAPI_FUNC(int) _Py_IsLocaleCoercionTarget(const char *ctype_loc);
|
|
|
|
|
2019-01-22 12:39:03 -04:00
|
|
|
/* Various one-time initializers */
|
|
|
|
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PyUnicode_Init(void);
|
2018-10-31 23:15:58 -03:00
|
|
|
extern int _PyStructSequence_Init(void);
|
|
|
|
extern int _PyLong_Init(void);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PyFaulthandler_Init(int enable);
|
2018-10-31 23:15:58 -03:00
|
|
|
extern int _PyTraceMalloc_Init(int enable);
|
2019-01-22 12:39:03 -04:00
|
|
|
extern PyObject * _PyBuiltin_Init(void);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PySys_Create(
|
2019-01-23 10:04:40 -04:00
|
|
|
PyInterpreterState *interp,
|
|
|
|
PyObject **sysmod_p);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PySys_SetPreliminaryStderr(PyObject *sysdict);
|
2019-06-01 00:16:47 -03:00
|
|
|
extern int _PySys_InitMain(PyInterpreterState *interp);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PyImport_Init(PyInterpreterState *interp);
|
|
|
|
extern PyStatus _PyExc_Init(void);
|
|
|
|
extern PyStatus _PyErr_Init(void);
|
|
|
|
extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod);
|
|
|
|
extern PyStatus _PyImportHooks_Init(void);
|
2019-01-22 12:39:03 -04:00
|
|
|
extern int _PyFloat_Init(void);
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-05-27 11:39:22 -03:00
|
|
|
extern PyStatus _PyTypes_Init(void);
|
|
|
|
extern PyStatus _PyImportZip_Init(PyInterpreterState *interp);
|
2019-05-13 12:12:45 -03:00
|
|
|
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-01-22 12:39:03 -04:00
|
|
|
/* Various internal finalizers */
|
|
|
|
|
|
|
|
extern void PyMethod_Fini(void);
|
|
|
|
extern void PyFrame_Fini(void);
|
|
|
|
extern void PyCFunction_Fini(void);
|
|
|
|
extern void PyDict_Fini(void);
|
|
|
|
extern void PyTuple_Fini(void);
|
|
|
|
extern void PyList_Fini(void);
|
|
|
|
extern void PySet_Fini(void);
|
|
|
|
extern void PyBytes_Fini(void);
|
|
|
|
extern void PyFloat_Fini(void);
|
|
|
|
extern void PyOS_FiniInterrupts(void);
|
|
|
|
extern void PySlice_Fini(void);
|
|
|
|
extern void PyAsyncGen_Fini(void);
|
|
|
|
|
|
|
|
extern void _PyExc_Fini(void);
|
|
|
|
extern void _PyImport_Fini(void);
|
|
|
|
extern void _PyImport_Fini2(void);
|
2019-04-24 12:24:01 -03:00
|
|
|
extern void _PyGC_Fini(_PyRuntimeState *runtime);
|
2019-01-22 12:39:03 -04:00
|
|
|
extern void _PyType_Fini(void);
|
|
|
|
extern void _Py_HashRandomization_Fini(void);
|
2018-10-31 23:15:58 -03:00
|
|
|
extern void _PyUnicode_Fini(void);
|
|
|
|
extern void PyLong_Fini(void);
|
|
|
|
extern void _PyFaulthandler_Fini(void);
|
|
|
|
extern void _PyHash_Fini(void);
|
|
|
|
extern int _PyTraceMalloc_Fini(void);
|
2019-05-10 14:29:55 -03:00
|
|
|
extern void _PyWarnings_Fini(PyInterpreterState *interp);
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-06-01 00:16:47 -03:00
|
|
|
extern void _PyGILState_Init(PyThreadState *tstate);
|
2019-04-24 12:24:01 -03:00
|
|
|
extern void _PyGILState_Fini(_PyRuntimeState *runtime);
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-04-25 21:32:01 -03:00
|
|
|
PyAPI_FUNC(void) _PyGC_DumpShutdownStats(_PyRuntimeState *runtime);
|
2018-10-31 23:15:58 -03:00
|
|
|
|
2019-05-27 11:39:22 -03:00
|
|
|
PyAPI_FUNC(PyStatus) _Py_PreInitializeFromPyArgv(
|
|
|
|
const PyPreConfig *src_config,
|
2019-05-02 16:25:34 -03:00
|
|
|
const _PyArgv *args);
|
2019-05-27 11:39:22 -03:00
|
|
|
PyAPI_FUNC(PyStatus) _Py_PreInitializeFromConfig(
|
|
|
|
const PyConfig *config,
|
2019-05-02 16:25:34 -03:00
|
|
|
const _PyArgv *args);
|
2019-03-25 22:31:11 -03:00
|
|
|
|
2019-05-22 06:28:22 -03:00
|
|
|
|
2019-05-17 18:05:29 -03:00
|
|
|
PyAPI_FUNC(int) _Py_HandleSystemExit(int *exitcode_p);
|
|
|
|
|
2019-05-22 06:28:22 -03:00
|
|
|
PyAPI_FUNC(PyObject*) _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable);
|
|
|
|
|
2019-05-24 12:01:38 -03:00
|
|
|
PyAPI_FUNC(void) _PyErr_Print(PyThreadState *tstate);
|
2019-05-27 19:39:52 -03:00
|
|
|
PyAPI_FUNC(void) _PyErr_Display(PyObject *file, PyObject *exception,
|
|
|
|
PyObject *value, PyObject *tb);
|
2019-05-24 12:01:38 -03:00
|
|
|
|
2018-10-31 23:15:58 -03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_INTERNAL_LIFECYCLE_H */
|