Encapuslate UTF-8 decoder state in a struct

This commit is contained in:
Rangi
2026-07-03 19:35:23 -04:00
parent e3c594c250
commit 0996a2f5ed
5 changed files with 36 additions and 34 deletions
+6 -1
View File
@@ -8,6 +8,11 @@
#define UTF8_ACCEPT 0
#define UTF8_REJECT 12
uint32_t decode(uint32_t *state, uint32_t *codep, uint8_t byte);
struct Utf8Decoder {
uint32_t state = UTF8_ACCEPT;
uint32_t codepoint = 0;
uint32_t update(uint8_t byte);
};
#endif // RGBDS_EXTERN_UTF8DECODER_HPP