File indexing completed on 2025-01-18 10:06:47
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
0017
0018
0019 extern void _PyUnicode_InitState(PyInterpreterState *);
0020 extern PyStatus _PyUnicode_InitGlobalObjects(PyInterpreterState *);
0021 extern PyStatus _PyUnicode_InitTypes(PyInterpreterState *);
0022 extern void _PyUnicode_Fini(PyInterpreterState *);
0023 extern void _PyUnicode_FiniTypes(PyInterpreterState *);
0024
0025 extern PyTypeObject _PyUnicodeASCIIIter_Type;
0026
0027
0028
0029 struct _Py_unicode_runtime_ids {
0030 PyThread_type_lock lock;
0031
0032
0033 Py_ssize_t next_index;
0034 };
0035
0036 struct _Py_unicode_runtime_state {
0037 struct _Py_unicode_runtime_ids ids;
0038 };
0039
0040
0041
0042 struct _Py_unicode_fs_codec {
0043 char *encoding;
0044 int utf8;
0045 char *errors;
0046 _Py_error_handler error_handler;
0047 };
0048
0049 struct _Py_unicode_ids {
0050 Py_ssize_t size;
0051 PyObject **array;
0052 };
0053
0054 struct _Py_unicode_state {
0055 struct _Py_unicode_fs_codec fs_codec;
0056
0057 _PyUnicode_Name_CAPI *ucnhash_capi;
0058
0059
0060 struct _Py_unicode_ids ids;
0061 };
0062
0063 extern void _PyUnicode_InternInPlace(PyInterpreterState *interp, PyObject **p);
0064 extern void _PyUnicode_ClearInterned(PyInterpreterState *interp);
0065
0066
0067 #ifdef __cplusplus
0068 }
0069 #endif
0070 #endif