diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-08-01 15:56:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 15:56:14 (GMT) |
commit | 6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6 (patch) | |
tree | 9f87d1708dd9895c78b5ac7d1b9bc31aa835e48f /Include/pylifecycle.h | |
parent | cfc8831f5ed607048679427f7d76d6cb4f8a2e8a (diff) | |
download | cpython-6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6.zip cpython-6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6.tar.gz cpython-6c785c0ebdadc84d80a53d896c38fd7ada8ae1f6.tar.bz2 |
bpo-34170: Add Python/coreconfig.c for _PyCoreConfig (GH-8607)
* Add Include/coreconfig.h
* Move config_*() and _PyCoreConfig_*() functions from Modules/main.c
to a new Python/coreconfig.c file.
* Inline _Py_ReadHashSeed() into config_init_hash_seed()
* Move global configuration variables to coreconfig.c
Diffstat (limited to 'Include/pylifecycle.h')
-rw-r--r-- | Include/pylifecycle.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index c58c7ec..4965d7c 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -7,36 +7,6 @@ extern "C" { #endif -#ifndef Py_LIMITED_API -typedef struct { - const char *prefix; - const char *msg; - int user_err; -} _PyInitError; - -/* Almost all errors causing Python initialization to fail */ -#ifdef _MSC_VER - /* Visual Studio 2015 doesn't implement C99 __func__ in C */ -# define _Py_INIT_GET_FUNC() __FUNCTION__ -#else -# define _Py_INIT_GET_FUNC() __func__ -#endif - -#define _Py_INIT_OK() \ - (_PyInitError){.prefix = NULL, .msg = NULL, .user_err = 0} -#define _Py_INIT_ERR(MSG) \ - (_PyInitError){.prefix = _Py_INIT_GET_FUNC(), .msg = (MSG), .user_err = 0} -/* Error that can be fixed by the user like invalid input parameter. - Don't abort() the process on such error. */ -#define _Py_INIT_USER_ERR(MSG) \ - (_PyInitError){.prefix = _Py_INIT_GET_FUNC(), .msg = (MSG), .user_err = 1} -#define _Py_INIT_NO_MEMORY() _Py_INIT_USER_ERR("memory allocation failed") -#define _Py_INIT_FAILED(err) \ - (err.msg != NULL) - -#endif - - PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); @@ -56,16 +26,6 @@ PyAPI_FUNC(_PyInitError) _Py_InitializeCore( const _PyCoreConfig *); PyAPI_FUNC(int) _Py_IsCoreInitialized(void); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *config); -PyAPI_FUNC(void) _PyCoreConfig_Clear(_PyCoreConfig *); -PyAPI_FUNC(int) _PyCoreConfig_Copy( - _PyCoreConfig *config, - const _PyCoreConfig *config2); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_InitPathConfig(_PyCoreConfig *config); -PyAPI_FUNC(_PyInitError) _PyCoreConfig_SetPathConfig( - const _PyCoreConfig *config); -PyAPI_FUNC(void) _PyCoreConfig_SetGlobalConfig(const _PyCoreConfig *config); - PyAPI_FUNC(_PyInitError) _PyMainInterpreterConfig_Read( _PyMainInterpreterConfig *config, @@ -165,12 +125,6 @@ PyAPI_FUNC(int) _PyFloat_Init(void); PyAPI_FUNC(int) PyByteArray_Init(void); PyAPI_FUNC(_PyInitError) _Py_HashRandomization_Init(const _PyCoreConfig *); #endif -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _Py_ReadHashSeed( - const char *seed_text, - int *use_hash_seed, - unsigned long *hash_seed); -#endif /* Various internal finalizers */ |