Commit | Line | Data |
0e06870b |
1 | #ifndef ENCODE_H |
2 | #define ENCODE_H |
3 | #ifndef U8 |
4 | typedef unsigned char U8; |
5 | #endif |
6 | |
7 | typedef struct encpage_s encpage_t; |
8 | |
9 | struct encpage_s |
10 | { |
11 | const U8 *seq; |
12 | encpage_t *next; |
13 | U8 min; |
14 | U8 max; |
15 | U8 dlen; |
16 | U8 slen; |
17 | }; |
18 | |
19 | typedef struct encode_s encode_t; |
20 | struct encode_s |
21 | { |
22 | const char *name; |
23 | encpage_t *t_utf8; |
24 | encpage_t *f_utf8; |
25 | const U8 *rep; |
26 | int replen; |
27 | }; |
28 | |
29 | #ifdef U8 |
30 | extern int do_encode(encpage_t *enc, const U8 *src, STRLEN *slen, |
31 | U8 *dst, STRLEN dlen, STRLEN *dout, int approx); |
32 | |
33 | extern void Encode_DefineEncoding(encode_t *enc); |
34 | #endif |
35 | |
36 | #define ENCODE_NOSPACE 1 |
37 | #define ENCODE_PARTIAL 2 |
38 | #define ENCODE_NOREP 3 |
39 | #define ENCODE_FALLBACK 4 |
40 | #endif |