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 /*
28  LC_COLLATE category + Level information
29 */
30 
31 #ifndef _t_ctype_h
32 #define _t_ctype_h
33 
34 typedef unsigned char tchar;
35 
36 #define TOT_LEVELS 5
37 #define LAST_LEVEL 4 /* TOT_LEVELS - 1 */
38 
39 #define IGNORE 0
40 
41 
42 /* level 1 symbols & order */
43 enum l1_symbols {
44  L1_08 = TOT_LEVELS,
45  L1_18,
46  L1_28,
47  L1_38,
48  L1_48,
49  L1_58,
50  L1_68,
51  L1_78,
52  L1_88,
53  L1_98,
54  L1_A8,
55  L1_B8,
56  L1_C8,
57  L1_D8,
58  L1_E8,
59  L1_F8,
60  L1_G8,
61  L1_H8,
62  L1_I8,
63  L1_J8,
64  L1_K8,
65  L1_L8,
66  L1_M8,
67  L1_N8,
68  L1_O8,
69  L1_P8,
70  L1_Q8,
71  L1_R8,
72  L1_S8,
73  L1_T8,
74  L1_U8,
75  L1_V8,
76  L1_W8,
77  L1_X8,
78  L1_Y8,
79  L1_Z8,
80  L1_KO_KAI,
81  L1_KHO_KHAI,
82  L1_KHO_KHUAT,
83  L1_KHO_KHWAI,
84  L1_KHO_KHON,
85  L1_KHO_RAKHANG,
86  L1_NGO_NGU,
87  L1_CHO_CHAN,
88  L1_CHO_CHING,
89  L1_CHO_CHANG,
90  L1_SO_SO,
91  L1_CHO_CHOE,
92  L1_YO_YING,
93  L1_DO_CHADA,
94  L1_TO_PATAK,
95  L1_THO_THAN,
96  L1_THO_NANGMONTHO,
97  L1_THO_PHUTHAO,
98  L1_NO_NEN,
99  L1_DO_DEK,
100  L1_TO_TAO,
101  L1_THO_THUNG,
102  L1_THO_THAHAN,
103  L1_THO_THONG,
104  L1_NO_NU,
105  L1_BO_BAIMAI,
106  L1_PO_PLA,
107  L1_PHO_PHUNG,
108  L1_FO_FA,
109  L1_PHO_PHAN,
110  L1_FO_FAN,
111  L1_PHO_SAMPHAO,
112  L1_MO_MA,
113  L1_YO_YAK,
114  L1_RO_RUA,
115  L1_RU,
116  L1_LO_LING,
117  L1_LU,
118  L1_WO_WAEN,
119  L1_SO_SALA,
120  L1_SO_RUSI,
121  L1_SO_SUA,
122  L1_HO_HIP,
123  L1_LO_CHULA,
124  L1_O_ANG,
125  L1_HO_NOKHUK,
126  L1_NKHIT,
127  L1_SARA_A,
128  L1_MAI_HAN_AKAT,
129  L1_SARA_AA,
130  L1_SARA_AM,
131  L1_SARA_I,
132  L1_SARA_II,
133  L1_SARA_UE,
134  L1_SARA_UEE,
135  L1_SARA_U,
136  L1_SARA_UU,
137  L1_SARA_E,
138  L1_SARA_AE,
139  L1_SARA_O,
140  L1_SARA_AI_MAIMUAN,
141  L1_SARA_AI_MAIMALAI
142 };
143 
144 /* level 2 symbols & order */
145 enum l2_symbols {
146  L2_BLANK = TOT_LEVELS,
147  L2_THAII,
148  L2_YAMAK,
149  L2_PINTHU,
150  L2_GARAN,
151  L2_TYKHU,
152  L2_TONE1,
153  L2_TONE2,
154  L2_TONE3,
155  L2_TONE4
156 };
157 
158 /* level 3 symbols & order */
159 enum l3_symbols {
160  L3_BLANK = TOT_LEVELS,
161  L3_SPACE,
162  L3_NB_SACE,
163  L3_LOW_LINE,
164  L3_HYPHEN,
165  L3_COMMA,
166  L3_SEMICOLON,
167  L3_COLON,
168  L3_EXCLAMATION,
169  L3_QUESTION,
170  L3_SOLIDUS,
171  L3_FULL_STOP,
172  L3_PAIYAN_NOI,
173  L3_MAI_YAMOK,
174  L3_GRAVE,
175  L3_CIRCUMFLEX,
176  L3_TILDE,
177  L3_APOSTROPHE,
178  L3_QUOTATION,
179  L3_L_PARANTHESIS,
180  L3_L_BRACKET,
181  L3_L_BRACE,
182  L3_R_BRACE,
183  L3_R_BRACKET,
184  L3_R_PARENTHESIS,
185  L3_AT,
186  L3_BAHT,
187  L3_DOLLAR,
188  L3_FONGMAN,
189  L3_ANGKHANKHU,
190  L3_KHOMUT,
191  L3_ASTERISK,
192  L3_BK_SOLIDUS,
193  L3_AMPERSAND,
194  L3_NUMBER,
195  L3_PERCENT,
196  L3_PLUS,
197  L3_LESS_THAN,
198  L3_EQUAL,
199  L3_GREATER_THAN,
200  L3_V_LINE
201 };
202 
203 /* level 4 symbols & order */
204 enum l4_symbols {
205  L4_BLANK = TOT_LEVELS,
206  L4_MIN,
207  L4_CAP,
208  L4_EXT
209 };
210 
211 enum level_symbols {
212  L_UPRUPR = TOT_LEVELS,
213  L_UPPER,
214  L_MIDDLE,
215  L_LOWER
216 };
217 
218 #define _is(c) (t_ctype[(c)][LAST_LEVEL])
219 #define _level 8
220 #define _consnt 16
221 #define _ldvowel 32
222 #define _fllwvowel 64
223 #define _uprvowel 128
224 #define _lwrvowel 256
225 #define _tone 512
226 #define _diacrt1 1024
227 #define _diacrt2 2048
228 #define _combine 4096
229 #define _stone 8192
230 #define _tdig 16384
231 #define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel)
232 #define _diacrt (_diacrt1 | _diacrt2)
233 #define levelof(c) ( _is(c) & _level )
234 #define isthai(c) ( (c) >= 128 )
235 #define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\
236  _tone|_diacrt1|_diacrt2) )
237 #define isconsnt(c) ( _is(c) & _consnt )
238 #define isldvowel(c) ( _is(c) & _ldvowel )
239 #define isfllwvowel(c) ( _is(c) & _fllwvowel )
240 #define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) )
241 #define isuprvowel(c) ( _is(c) & _uprvowel )
242 #define islwrvowel(c) ( _is(c) & _lwrvowel )
243 #define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel))
244 #define isrearvowel(c) ( _is(c) & _rearvowel )
245 #define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) )
246 #define istone(c) ( _is(c) & _tone )
247 #define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) )
248 #define iscombinable(c) ( _is(c) & _combine )
249 #define istdigit(c) ( _is(c) & _tdig )
250 #define isstone(c) ( _is(c) & _stone )
251 #define isdiacrt1(c) ( _is(c) & _diacrt1)
252 #define isdiacrt2(c) ( _is(c) & _diacrt2)
253 #define isdiacrt(c) ( _is(c) & _diacrt)
254 
255 /* Function prototype called by sql/field.cc */
256 void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length);
257 
258 #endif