mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
GH-131238: Core header refactor (GH-131250)
* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h * Removes many cross-header dependencies
This commit is contained in:
parent
3ae67ba97e
commit
a1aeec61c4
57 changed files with 1481 additions and 1356 deletions
|
@ -9,6 +9,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include "pycore_lock.h" // PyMutex
|
||||
#include "pycore_runtime_structs.h" // struct codecs_state
|
||||
|
||||
/* Initialize codecs-related state for the given interpreter, including
|
||||
registering the first codec search function. Must be called before any other
|
||||
|
@ -70,27 +71,6 @@ extern PyObject* _PyCodecInfo_GetIncrementalEncoder(
|
|||
PyObject *codec_info,
|
||||
const char *errors);
|
||||
|
||||
// Per-interpreter state used by codecs.c.
|
||||
struct codecs_state {
|
||||
// A list of callable objects used to search for codecs.
|
||||
PyObject *search_path;
|
||||
|
||||
// A dict mapping codec names to codecs returned from a callable in
|
||||
// search_path.
|
||||
PyObject *search_cache;
|
||||
|
||||
// A dict mapping error handling strategies to functions to implement them.
|
||||
PyObject *error_registry;
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
// Used to safely delete a specific item from search_path.
|
||||
PyMutex search_path_mutex;
|
||||
#endif
|
||||
|
||||
// Whether or not the rest of the state is initialized.
|
||||
int initialized;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue