mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-04 11:15:39 +00:00
Encapuslate UTF-8 decoder state in a struct
This commit is contained in:
1 parent
e3c594c250
commit
0996a2f5ed
5 files changed
+36
-34
No files matched your search
Vendored
+6
-1
@@ -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
|
||||
Reference in new issue
Block a user