File indexing completed on 2025-11-19 09:50:45
0001 #ifndef Py_INTERNAL_CODECS_H
0002 #define Py_INTERNAL_CODECS_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_lock.h" // PyMutex
0012
0013
0014
0015
0016 extern PyStatus _PyCodec_InitRegistry(PyInterpreterState *interp);
0017
0018
0019
0020 extern void _PyCodec_Fini(PyInterpreterState *interp);
0021
0022 extern PyObject* _PyCodec_Lookup(const char *encoding);
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 extern PyObject* _PyCodec_LookupTextEncoding(
0038 const char *encoding,
0039 const char *alternate_command);
0040
0041 extern PyObject* _PyCodec_EncodeText(
0042 PyObject *object,
0043 const char *encoding,
0044 const char *errors);
0045
0046 extern PyObject* _PyCodec_DecodeText(
0047 PyObject *object,
0048 const char *encoding,
0049 const char *errors);
0050
0051
0052
0053
0054 extern PyObject* _PyCodecInfo_GetIncrementalDecoder(
0055 PyObject *codec_info,
0056 const char *errors);
0057
0058 extern PyObject* _PyCodecInfo_GetIncrementalEncoder(
0059 PyObject *codec_info,
0060 const char *errors);
0061
0062
0063 struct codecs_state {
0064
0065 PyObject *search_path;
0066
0067
0068
0069 PyObject *search_cache;
0070
0071
0072 PyObject *error_registry;
0073
0074 #ifdef Py_GIL_DISABLED
0075
0076 PyMutex search_path_mutex;
0077 #endif
0078
0079
0080 int initialized;
0081 };
0082
0083 #ifdef __cplusplus
0084 }
0085 #endif
0086 #endif