summaryrefslogtreecommitdiff
path: root/src/utf8.h
blob: f5e7be1220b9de1de099ee0122c2f5e9e5ed174d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);

BOOL encode(NUM code_point, str *result);

#endif