From d9d8a49925d6a4f17241860cb37f11025104b3cc Mon Sep 17 00:00:00 2001 From: Martin Fouilleul Date: Fri, 4 Oct 2024 19:29:01 +0200 Subject: [PATCH] fix doc of utf8 functions --- src/api.json | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/api.json b/src/api.json index be29ebeb..ee5aad08 100644 --- a/src/api.json +++ b/src/api.json @@ -3769,6 +3769,61 @@ "kind": "u32" } }, + { + "kind": "typename", + "name": "oc_utf8_status", + "doc": "This enum declares the possible return status of UTF8 decoding/encoding operations.", + "type": { + "kind": "enum", + "type": { + "kind": "u32" + }, + "constants": [ + { + "kind": "enum-constant", + "name": "OC_UTF8_OK", + "doc": "The operation was successful.", + "value": 0 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_OUT_OF_BOUNDS", + "doc": "The operation unexpectedly encountered the end of the utf8 sequence.", + "value": 1 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_UNEXPECTED_CONTINUATION_BYTE", + "doc": "A continuation byte was encountered where a leading byte was expected.", + "value": 3 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_UNEXPECTED_LEADING_BYTE", + "doc": "A leading byte was encountered in the middle of the encoding of utf8 codepoint.", + "value": 4 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_INVALID_BYTE", + "doc": "The utf8 sequence contains an invalid byte.", + "value": 5 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_INVALID_CODEPOINT", + "doc": "The operation encountered an invalid utf8 codepoint.", + "value": 6 + }, + { + "kind": "enum-constant", + "name": "OC_UTF8_OVERLONG_ENCODING", + "doc": "The utf8 sequence contains an overlong encoding of a utf8 codepoint.", + "value": 7 + } + ] + } + }, { "kind": "proc", "name": "oc_utf8_size_from_leading_char", @@ -3902,6 +3957,14 @@ "type": { "kind": "struct", "fields": [ + { + "name": "status", + "doc": "The status of the decoding operation. If not `OC_UTF8_OK`, it describes the error that was encountered during decoding.", + "type": { + "kind": "namedType", + "name": "oc_utf8_status" + } + }, { "name": "codepoint", "doc": "The decoded codepoint.",