diff options
Diffstat (limited to 'fw/fe310/eos/unicode.h')
-rw-r--r-- | fw/fe310/eos/unicode.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/fw/fe310/eos/unicode.h b/fw/fe310/eos/unicode.h index 12fa99c..1204ea8 100644 --- a/fw/fe310/eos/unicode.h +++ b/fw/fe310/eos/unicode.h @@ -1,19 +1,23 @@ +#include <sys/types.h> #include <stdint.h> #define UTF_OK 0 #define UTF_ERR -1 typedef uint8_t utf8_t; -typedef uint16_t utf16_t; -typedef uint32_t utf32_t; +typedef uint8_t utf16_t; +/* unicode code point*/ +typedef uint32_t ucp_t; -int utf8_enc(utf32_t ch, utf8_t *str); -int utf8_dec(utf8_t *str, utf32_t *ch); -int utf8_len(utf8_t *str); -int utf8_seek(utf8_t *str, int off, utf32_t *ch); -int utf8_verify(utf8_t *str, int str_size, int *str_len); +int utf8_enc(ucp_t ch, utf8_t *str); +int utf8_dec(utf8_t *str, ucp_t *ch); +int utf8_len_ch(ucp_t ch); +int utf8_len_str(utf8_t *str); +int utf8_seek(utf8_t *str, int off, ucp_t *ch); +int utf8_verify(utf8_t *str, size_t str_size, size_t *str_len); -int utf16_enc(utf32_t ch, uint8_t *str); -int utf16_dec(uint8_t *str, utf32_t *ch); -int utf16_len(uint8_t *str); -int utf16_seek(uint8_t *str, int off, utf32_t *ch); +int utf16_enc(ucp_t ch, utf16_t *str); +int utf16_dec(utf16_t *str, ucp_t *ch); +int utf16_len_ch(ucp_t ch); +int utf16_len_str(utf16_t *str); +int utf16_seek(utf16_t *str, int off, ucp_t *ch); |