Back to home page

EIC code displayed by LXR

 
 

    


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 /* runtime lifecycle */
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 /* other API */
0028 
0029 struct _Py_unicode_runtime_ids {
0030     PyThread_type_lock lock;
0031     // next_index value must be preserved when Py_Initialize()/Py_Finalize()
0032     // is called multiple times: see _PyUnicode_FromId() implementation.
0033     Py_ssize_t next_index;
0034 };
0035 
0036 struct _Py_unicode_runtime_state {
0037     struct _Py_unicode_runtime_ids ids;
0038 };
0039 
0040 /* fs_codec.encoding is initialized to NULL.
0041    Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */
0042 struct _Py_unicode_fs_codec {
0043     char *encoding;   // Filesystem encoding (encoded to UTF-8)
0044     int utf8;         // encoding=="utf-8"?
0045     char *errors;     // Filesystem errors (encoded to UTF-8)
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     // Unicode identifiers (_Py_Identifier): see _PyUnicode_FromId()
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 /* !Py_INTERNAL_UNICODEOBJECT_H */