File indexing completed on 2025-09-18 09:25:57
0001 #ifndef Py_INTERNAL_UNICODEOBJECT_H
0002 #define Py_INTERNAL_UNICODEOBJECT_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_fileutils.h" // _Py_error_handler
0012 #include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
0013
0014 void _PyUnicode_ExactDealloc(PyObject *op);
0015 Py_ssize_t _PyUnicode_InternedSize(void);
0016 Py_ssize_t _PyUnicode_InternedSize_Immortal(void);
0017
0018
0019
0020 extern void _PyUnicode_InitState(PyInterpreterState *);
0021 extern PyStatus _PyUnicode_InitGlobalObjects(PyInterpreterState *);
0022 extern PyStatus _PyUnicode_InitInternDict(PyInterpreterState *);
0023 extern PyStatus _PyUnicode_InitTypes(PyInterpreterState *);
0024 extern void _PyUnicode_Fini(PyInterpreterState *);
0025 extern void _PyUnicode_FiniTypes(PyInterpreterState *);
0026
0027 extern PyTypeObject _PyUnicodeASCIIIter_Type;
0028
0029
0030
0031
0032
0033
0034 PyAPI_FUNC(void) _PyUnicode_InternMortal(PyInterpreterState *interp, PyObject **);
0035 PyAPI_FUNC(void) _PyUnicode_InternImmortal(PyInterpreterState *interp, PyObject **);
0036
0037 PyAPI_FUNC(void) _PyUnicode_InternInPlace(PyInterpreterState *interp, PyObject **p);
0038
0039 extern void _PyUnicode_InternStatic(PyInterpreterState *interp, PyObject **);
0040
0041
0042
0043 struct _Py_unicode_runtime_ids {
0044 PyThread_type_lock lock;
0045
0046
0047 Py_ssize_t next_index;
0048 };
0049
0050 struct _Py_unicode_runtime_state {
0051 struct _Py_unicode_runtime_ids ids;
0052 };
0053
0054
0055
0056 struct _Py_unicode_fs_codec {
0057 char *encoding;
0058 int utf8;
0059 char *errors;
0060 _Py_error_handler error_handler;
0061 };
0062
0063 struct _Py_unicode_ids {
0064 Py_ssize_t size;
0065 PyObject **array;
0066 };
0067
0068 struct _Py_unicode_state {
0069 struct _Py_unicode_fs_codec fs_codec;
0070
0071 _PyUnicode_Name_CAPI *ucnhash_capi;
0072
0073
0074 struct _Py_unicode_ids ids;
0075 };
0076
0077 extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);
0078
0079
0080 extern const char* _PyUnicode_AsUTF8NoNUL(PyObject *);
0081
0082
0083 #ifdef __cplusplus
0084 }
0085 #endif
0086 #endif