From 55dc897da6e81f2a26cfc7e66ac942824773498b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 4 Jan 2022 11:51:58 +0800 Subject: temporary commit Now we can read grammars from a file. But we need to check if it works for reading strings still. --- src/utf8.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/utf8.h (limited to 'src/utf8.h') diff --git a/src/utf8.h b/src/utf8.h new file mode 100644 index 0000000..5b3c9f2 --- /dev/null +++ b/src/utf8.h @@ -0,0 +1,25 @@ +#ifndef UTF8_H +#define UTF8_H +#include "str.h" + +typedef struct utf8_s utf8; + +enum UTF8_State_e { + UTF8_STATE_ACCEPT = 0, + UTF8_STATE_REJECT = 12, + UTF8_STATE_1 = 24, + UTF8_STATE_2 = 36, + UTF8_STATE_3 = 48, + UTF8_STATE_4 = 60, + UTF8_STATE_5 = 72, + UTF8_STATE_6 = 84, + UTF8_STATE_7 = 96 +}; + +typedef enum UTF8_State_e UTF8_State; + +utf8 *new_utf8(char *string, UNUM size); + +unsigned char encode(NUM code_point, str *result); + +#endif -- cgit v1.2.3-18-g5258