1
/* Copyright (C) 2000 MySQL AB
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
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.
28
LC_COLLATE category + Level information
34
typedef unsigned char tchar;
37
#define LAST_LEVEL 4 /* TOT_LEVELS - 1 */
42
/* level 1 symbols & order */
144
/* level 2 symbols & order */
146
L2_BLANK = TOT_LEVELS,
158
/* level 3 symbols & order */
160
L3_BLANK = TOT_LEVELS,
203
/* level 4 symbols & order */
205
L4_BLANK = TOT_LEVELS,
212
L_UPRUPR = TOT_LEVELS,
218
#define _is(c) (t_ctype[(c)][LAST_LEVEL])
222
#define _fllwvowel 64
223
#define _uprvowel 128
224
#define _lwrvowel 256
226
#define _diacrt1 1024
227
#define _diacrt2 2048
228
#define _combine 4096
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)
255
/* Function prototype called by sql/field.cc */
256
void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length);