mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-20 05:44:32 +00:00
Encapuslate UTF-8 decoder state in a struct
This commit is contained in:
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