summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-21 17:33:15 (GMT)
committerGitHub <noreply@github.com>2024-06-21 17:33:15 (GMT)
commit4123226bbda437b64b60c9111d3e4cc9dc76f7d5 (patch)
tree6bb6ff8c51815b10afceb455a10912ed43ca38c5 /Include
parentaed31beca9a54b85a1392631a48da80602210f18 (diff)
downloadcpython-4123226bbda437b64b60c9111d3e4cc9dc76f7d5.zip
cpython-4123226bbda437b64b60c9111d3e4cc9dc76f7d5.tar.gz
cpython-4123226bbda437b64b60c9111d3e4cc9dc76f7d5.tar.bz2
gh-119182: Add PyUnicodeWriter_DecodeUTF8Stateful() (#120639)
Add PyUnicodeWriter_WriteWideChar() and PyUnicodeWriter_DecodeUTF8Stateful() functions. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/unicodeobject.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h
index e5e1b6b..059bec8 100644
--- a/Include/cpython/unicodeobject.h
+++ b/Include/cpython/unicodeobject.h
@@ -459,6 +459,10 @@ PyAPI_FUNC(int) PyUnicodeWriter_WriteUTF8(
PyUnicodeWriter *writer,
const char *str,
Py_ssize_t size);
+PyAPI_FUNC(int) PyUnicodeWriter_WriteWideChar(
+ PyUnicodeWriter *writer,
+ const wchar_t *str,
+ Py_ssize_t size);
PyAPI_FUNC(int) PyUnicodeWriter_WriteStr(
PyUnicodeWriter *writer,
@@ -475,6 +479,12 @@ PyAPI_FUNC(int) PyUnicodeWriter_Format(
PyUnicodeWriter *writer,
const char *format,
...);
+PyAPI_FUNC(int) PyUnicodeWriter_DecodeUTF8Stateful(
+ PyUnicodeWriter *writer,
+ const char *string, /* UTF-8 encoded string */
+ Py_ssize_t length, /* size of string */
+ const char *errors, /* error handling */
+ Py_ssize_t *consumed); /* bytes consumed */
/* --- Private _PyUnicodeWriter API --------------------------------------- */