MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
t_ctype.h
1 /* Copyright (C) 2000 MySQL AB
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
15 
16 /*
17  Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved.
18  Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved.
19  Permission to use, copy, modify, distribute and sell this software
20  and its documentation for any purpose is hereby granted without fee,
21  provided that the above copyright notice appear in all copies.
22  Smaphan Raruenrom and Pruet Boonma makes no representations about
23  the suitability of this software for any purpose. It is provided
24  "as is" without express or implied warranty.
25 */
26 
27 /* LC_COLLATE category + Level information */
28 
29 #ifndef _t_ctype_h
30 #define _t_ctype_h
31 
32 #define TOT_LEVELS 5
33 #define LAST_LEVEL 4 /* TOT_LEVELS - 1 */
34 
35 #define IGNORE 0
36 
37 
38 /* level 1 symbols & order */
39 enum l1_symbols {
40  L1_08 = TOT_LEVELS,
41  L1_18,
42  L1_28,
43  L1_38,
44  L1_48,
45  L1_58,
46  L1_68,
47  L1_78,
48  L1_88,
49  L1_98,
50  L1_A8,
51  L1_B8,
52  L1_C8,
53  L1_D8,
54  L1_E8,
55  L1_F8,
56  L1_G8,
57  L1_H8,
58  L1_I8,
59  L1_J8,
60  L1_K8,
61  L1_L8,
62  L1_M8,
63  L1_N8,
64  L1_O8,
65  L1_P8,
66  L1_Q8,
67  L1_R8,
68  L1_S8,
69  L1_T8,
70  L1_U8,
71  L1_V8,
72  L1_W8,
73  L1_X8,
74  L1_Y8,
75  L1_Z8,
76  L1_KO_KAI,
77  L1_KHO_KHAI,
78  L1_KHO_KHUAT,
79  L1_KHO_KHWAI,
80  L1_KHO_KHON,
81  L1_KHO_RAKHANG,
82  L1_NGO_NGU,
83  L1_CHO_CHAN,
84  L1_CHO_CHING,
85  L1_CHO_CHANG,
86  L1_SO_SO,
87  L1_CHO_CHOE,
88  L1_YO_YING,
89  L1_DO_CHADA,
90  L1_TO_PATAK,
91  L1_THO_THAN,
92  L1_THO_NANGMONTHO,
93  L1_THO_PHUTHAO,
94  L1_NO_NEN,
95  L1_DO_DEK,
96  L1_TO_TAO,
97  L1_THO_THUNG,
98  L1_THO_THAHAN,
99  L1_THO_THONG,
100  L1_NO_NU,
101  L1_BO_BAIMAI,
102  L1_PO_PLA,
103  L1_PHO_PHUNG,
104  L1_FO_FA,
105  L1_PHO_PHAN,
106  L1_FO_FAN,
107  L1_PHO_SAMPHAO,
108  L1_MO_MA,
109  L1_YO_YAK,
110  L1_RO_RUA,
111  L1_RU,
112  L1_LO_LING,
113  L1_LU,
114  L1_WO_WAEN,
115  L1_SO_SALA,
116  L1_SO_RUSI,
117  L1_SO_SUA,
118  L1_HO_HIP,
119  L1_LO_CHULA,
120  L1_O_ANG,
121  L1_HO_NOKHUK,
122  L1_NKHIT,
123  L1_SARA_A,
124  L1_MAI_HAN_AKAT,
125  L1_SARA_AA,
126  L1_SARA_AM,
127  L1_SARA_I,
128  L1_SARA_II,
129  L1_SARA_UE,
130  L1_SARA_UEE,
131  L1_SARA_U,
132  L1_SARA_UU,
133  L1_SARA_E,
134  L1_SARA_AE,
135  L1_SARA_O,
136  L1_SARA_AI_MAIMUAN,
137  L1_SARA_AI_MAIMALAI
138 };
139 
140 /* level 2 symbols & order */
141 enum l2_symbols {
142  L2_BLANK = TOT_LEVELS,
143  L2_THAII,
144  L2_YAMAK,
145  L2_PINTHU,
146  L2_GARAN,
147  L2_TYKHU,
148  L2_TONE1,
149  L2_TONE2,
150  L2_TONE3,
151  L2_TONE4
152 };
153 
154 /* level 3 symbols & order */
155 enum l3_symbols {
156  L3_BLANK = TOT_LEVELS,
157  L3_SPACE,
158  L3_NB_SACE,
159  L3_LOW_LINE,
160  L3_HYPHEN,
161  L3_COMMA,
162  L3_SEMICOLON,
163  L3_COLON,
164  L3_EXCLAMATION,
165  L3_QUESTION,
166  L3_SOLIDUS,
167  L3_FULL_STOP,
168  L3_PAIYAN_NOI,
169  L3_MAI_YAMOK,
170  L3_GRAVE,
171  L3_CIRCUMFLEX,
172  L3_TILDE,
173  L3_APOSTROPHE,
174  L3_QUOTATION,
175  L3_L_PARANTHESIS,
176  L3_L_BRACKET,
177  L3_L_BRACE,
178  L3_R_BRACE,
179  L3_R_BRACKET,
180  L3_R_PARENTHESIS,
181  L3_AT,
182  L3_BAHT,
183  L3_DOLLAR,
184  L3_FONGMAN,
185  L3_ANGKHANKHU,
186  L3_KHOMUT,
187  L3_ASTERISK,
188  L3_BK_SOLIDUS,
189  L3_AMPERSAND,
190  L3_NUMBER,
191  L3_PERCENT,
192  L3_PLUS,
193  L3_LESS_THAN,
194  L3_EQUAL,
195  L3_GREATER_THAN,
196  L3_V_LINE
197 };
198 
199 /* level 4 symbols & order */
200 enum l4_symbols {
201  L4_BLANK = TOT_LEVELS,
202  L4_MIN,
203  L4_CAP,
204  L4_EXT
205 };
206 
207 enum level_symbols {
208  L_UPRUPR = TOT_LEVELS,
209  L_UPPER,
210  L_MIDDLE,
211  L_LOWER
212 };
213 
214 #define _is(c) (t_ctype[(c)][LAST_LEVEL])
215 #define _level 8
216 #define _consnt 16
217 #define _ldvowel 32
218 #define _fllwvowel 64
219 #define _uprvowel 128
220 #define _lwrvowel 256
221 #define _tone 512
222 #define _diacrt1 1024
223 #define _diacrt2 2048
224 #define _combine 4096
225 #define _stone 8192
226 #define _tdig 16384
227 #define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel)
228 #define _diacrt (_diacrt1 | _diacrt2)
229 #define levelof(c) ( _is(c) & _level )
230 #define isthai(c) ( (c) >= 128 )
231 #define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\
232  _tone|_diacrt1|_diacrt2) )
233 #define isconsnt(c) ( _is(c) & _consnt )
234 #define isldvowel(c) ( _is(c) & _ldvowel )
235 #define isfllwvowel(c) ( _is(c) & _fllwvowel )
236 #define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) )
237 #define isuprvowel(c) ( _is(c) & _uprvowel )
238 #define islwrvowel(c) ( _is(c) & _lwrvowel )
239 #define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel))
240 #define isrearvowel(c) ( _is(c) & _rearvowel )
241 #define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) )
242 #define istone(c) ( _is(c) & _tone )
243 #define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) )
244 #define iscombinable(c) ( _is(c) & _combine )
245 #define istdigit(c) ( _is(c) & _tdig )
246 #define isstone(c) ( _is(c) & _stone )
247 #define isdiacrt1(c) ( _is(c) & _diacrt1)
248 #define isdiacrt2(c) ( _is(c) & _diacrt2)
249 #define isdiacrt(c) ( _is(c) & _diacrt)
250 
251 /* Function prototype called by sql/field.cc */
252 void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length);
253 
254 #endif