Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8456 | maxcodehac | 1 | #ifndef js_utf_h |
2 | #define js_utf_h |
||
3 | |||
4 | typedef int Rune; /* 32 bits */ |
||
5 | |||
6 | #define chartorune jsU_chartorune |
||
7 | #define runetochar jsU_runetochar |
||
8 | #define runelen jsU_runelen |
||
9 | #define utflen jsU_utflen |
||
10 | |||
11 | #define isalpharune jsU_isalpharune |
||
12 | #define islowerrune jsU_islowerrune |
||
13 | #define isspacerune jsU_isspacerune |
||
14 | #define istitlerune jsU_istitlerune |
||
15 | #define isupperrune jsU_isupperrune |
||
16 | #define tolowerrune jsU_tolowerrune |
||
17 | #define totitlerune jsU_totitlerune |
||
18 | #define toupperrune jsU_toupperrune |
||
19 | |||
20 | enum |
||
21 | { |
||
22 | UTFmax = 4, /* maximum bytes per rune */ |
||
23 | Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */ |
||
24 | Runeself = 0x80, /* rune and UTF sequences are the same (<) */ |
||
25 | Runeerror = 0xFFFD, /* decoding error in UTF */ |
||
26 | Runemax = 0x10FFFF, /* maximum rune value */ |
||
27 | }; |
||
28 | |||
29 | int chartorune(Rune *rune, const char *str); |
||
30 | int runetochar(char *str, const Rune *rune); |
||
31 | int runelen(int c); |
||
32 | int utflen(const char *s); |
||
33 | |||
34 | int isalpharune(Rune c); |
||
35 | int islowerrune(Rune c); |
||
36 | int isspacerune(Rune c); |
||
37 | int istitlerune(Rune c); |
||
38 | int isupperrune(Rune c); |
||
39 | Rune tolowerrune(Rune c); |
||
40 | Rune totitlerune(Rune c); |
||
41 | Rune toupperrune(Rune c); |
||
42 | |||
43 | #endif)>)> |