beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / unilib / utype.h
blobe558ea2b4ebd7e425d3a765a8235e32dcc5083f3
1 #ifndef _UTYPE_H
2 #define _UTYPE_H
4 /* This file was generated using the program 'makeutype' */
6 #include <unibasics.h> /* Include here so we can use pre-defined int types to correctly size constant data arrays. */
7 #include <ctype.h> /* Include here so we can control it. If a system header includes it later bad things happen */
8 #ifdef tolower
9 # undef tolower
10 #endif
11 #ifdef toupper
12 # undef toupper
13 #endif
14 #ifdef islower
15 # undef islower
16 #endif
17 #ifdef isupper
18 # undef isupper
19 #endif
20 #ifdef isalpha
21 # undef isalpha
22 #endif
23 #ifdef isdigit
24 # undef isdigit
25 #endif
26 #ifdef isalnum
27 # undef isalnum
28 #endif
29 #ifdef isspace
30 # undef isspace
31 #endif
32 #ifdef ispunct
33 # undef ispunct
34 #endif
35 #ifdef ishexdigit
36 # undef ishexdigit
37 #endif
39 #define ____L 0x1
40 #define ____U 0x2
41 #define ____TITLE 0x4
42 #define ____D 0x8
43 #define ____S 0x10
44 #define ____P 0x20
45 #define ____X 0x40
46 #define ____ZW 0x80
47 #define ____L2R 0x100
48 #define ____R2L 0x200
49 #define ____ENUM 0x400
50 #define ____ANUM 0x800
51 #define ____ENS 0x1000
52 #define ____CS 0x2000
53 #define ____ENT 0x4000
54 #define ____COMBINE 0x8000
55 #define ____BB 0x10000
56 #define ____BA 0x20000
57 #define ____NS 0x40000
58 #define ____NE 0x80000
59 #define ____UB 0x100000
60 #define ____NB 0x8000000
61 #define ____AL 0x200000
62 #define ____ID 0x400000
63 #define ____INITIAL 0x800000
64 #define ____MEDIAL 0x1000000
65 #define ____FINAL 0x2000000
66 #define ____ISOLATED 0x4000000
67 #define ____DECOMPNORM 0x10000000
69 extern const unsigned short ____tolower[];
70 extern const unsigned short ____toupper[];
71 extern const unsigned short ____totitle[];
72 extern const unsigned short ____tomirror[];
73 extern const unsigned char ____digitval[];
74 extern const uint32 ____utype[];
76 #define ____COMBININGCLASS 0xff
77 #define ____ABOVE 0x100
78 #define ____BELOW 0x200
79 #define ____OVERSTRIKE 0x400
80 #define ____LEFT 0x800
81 #define ____RIGHT 0x1000
82 #define ____JOINS2 0x2000
83 #define ____CENTERLEFT 0x4000
84 #define ____CENTERRIGHT 0x8000
85 #define ____CENTEREDOUTSIDE 0x10000
86 #define ____OUTSIDE 0x20000
87 #define ____LEFTEDGE 0x80000
88 #define ____RIGHTEDGE 0x40000
89 #define ____TOUCHING 0x100000
90 #define ____COMBININGPOSMASK 0x1fff00
91 #define ____NOPOSDATAGIVEN (uint32)(-1) /* -1 == no position data given */
93 #define combiningclass(ch) (____utype2[(ch)+1]&____COMBININGCLASS)
94 #define combiningposmask(ch) (____utype2[(ch)+1]&____COMBININGPOSMASK)
96 extern const uint32 ____utype2[]; /* hold position boolean flags for each Unicode.org defined character */
98 #define isunicodepointassigned(ch) (____codepointassigned[(ch)/32]&(1<<((ch)%32)))
100 extern const uint32 ____codepointassigned[]; /* 1bit_boolean_flag x 32 = exists in Unicode.org character chart list. */
102 #define tolower(ch) (____tolower[(ch)+1])
103 #define toupper(ch) (____toupper[(ch)+1])
104 #define totitle(ch) (____totitle[(ch)+1])
105 #define tomirror(ch) (____tomirror[(ch)+1])
106 #define tovalue(ch) (____digitval[(ch)+1])
107 #define islower(ch) (____utype[(ch)+1]&____L)
108 #define isupper(ch) (____utype[(ch)+1]&____U)
109 #define istitle(ch) (____utype[(ch)+1]&____TITLE)
110 #define isalpha(ch) (____utype[(ch)+1]&(____L|____U|____TITLE|____AL))
111 #define isdigit(ch) (____utype[(ch)+1]&____D)
112 #define isalnum(ch) (____utype[(ch)+1]&(____L|____U|____TITLE|____AL|____D))
113 #define isideographic(ch) (____utype[(ch)+1]&____ID)
114 #define isideoalpha(ch) (____utype[(ch)+1]&(____ID|____L|____U|____TITLE|____AL))
115 #define isspace(ch) (____utype[(ch)+1]&____S)
116 #define ispunct(ch) (____utype[(ch)+1]&____P)
117 #define ishexdigit(ch) (____utype[(ch)+1]&____X)
118 #define iszerowidth(ch) (____utype[(ch)+1]&____ZW)
119 #define islefttoright(ch) (____utype[(ch)+1]&____L2R)
120 #define isrighttoleft(ch) (____utype[(ch)+1]&____R2L)
121 #define iseuronumeric(ch) (____utype[(ch)+1]&____ENUM)
122 #define isarabnumeric(ch) (____utype[(ch)+1]&____ANUM)
123 #define iseuronumsep(ch) (____utype[(ch)+1]&____ENS)
124 #define iscommonsep(ch) (____utype[(ch)+1]&____CS)
125 #define iseuronumterm(ch) (____utype[(ch)+1]&____ENT)
126 #define iscombining(ch) (____utype[(ch)+1]&____COMBINE)
127 #define isbreakbetweenok(ch1,ch2) (((____utype[(ch1)+1]&____BA) && !(____utype[(ch2)+1]&____NS)) || ((____utype[(ch2)+1]&____BB) && !(____utype[(ch1)+1]&____NE)) || (!(____utype[(ch2)+1]&____D) && ch1=='/'))
128 #define isnobreak(ch) (____utype[(ch)+1]&____NB)
129 #define isarabinitial(ch) (____utype[(ch)+1]&____INITIAL)
130 #define isarabmedial(ch) (____utype[(ch)+1]&____MEDIAL)
131 #define isarabfinal(ch) (____utype[(ch)+1]&____FINAL)
132 #define isarabisolated(ch) (____utype[(ch)+1]&____ISOLATED)
134 #define isdecompositionnormative(ch) (____utype[(ch)+1]&____DECOMPNORM)
138 extern struct arabicforms {
139 unsigned short initial, medial, final, isolated;
140 unsigned int isletter: 1;
141 unsigned int joindual: 1;
142 unsigned int required_lig_with_alef: 1;
143 } ArabicForms[256]; /* for chars 0x600-0x6ff, subtract 0x600 to use array */
145 #define _SOFT_HYPHEN 0xad
147 #define _DOUBLE_S 0xdf
149 #endif