Eneboo - Documentación para desarrolladores
|
00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* 00018 Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. 00019 Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. 00020 Permission to use, copy, modify, distribute and sell this software 00021 and its documentation for any purpose is hereby granted without fee, 00022 provided that the above copyright notice appear in all copies. 00023 Smaphan Raruenrom and Pruet Boonma makes no representations about 00024 the suitability of this software for any purpose. It is provided 00025 "as is" without express or implied warranty. 00026 */ 00027 00028 /* LC_COLLATE category + Level information */ 00029 00030 #ifndef _t_ctype_h 00031 #define _t_ctype_h 00032 00033 #define TOT_LEVELS 5 00034 #define LAST_LEVEL 4 /* TOT_LEVELS - 1 */ 00035 00036 #define IGNORE 0 00037 00038 00039 /* level 1 symbols & order */ 00040 enum l1_symbols { 00041 L1_08 = TOT_LEVELS, 00042 L1_18, 00043 L1_28, 00044 L1_38, 00045 L1_48, 00046 L1_58, 00047 L1_68, 00048 L1_78, 00049 L1_88, 00050 L1_98, 00051 L1_A8, 00052 L1_B8, 00053 L1_C8, 00054 L1_D8, 00055 L1_E8, 00056 L1_F8, 00057 L1_G8, 00058 L1_H8, 00059 L1_I8, 00060 L1_J8, 00061 L1_K8, 00062 L1_L8, 00063 L1_M8, 00064 L1_N8, 00065 L1_O8, 00066 L1_P8, 00067 L1_Q8, 00068 L1_R8, 00069 L1_S8, 00070 L1_T8, 00071 L1_U8, 00072 L1_V8, 00073 L1_W8, 00074 L1_X8, 00075 L1_Y8, 00076 L1_Z8, 00077 L1_KO_KAI, 00078 L1_KHO_KHAI, 00079 L1_KHO_KHUAT, 00080 L1_KHO_KHWAI, 00081 L1_KHO_KHON, 00082 L1_KHO_RAKHANG, 00083 L1_NGO_NGU, 00084 L1_CHO_CHAN, 00085 L1_CHO_CHING, 00086 L1_CHO_CHANG, 00087 L1_SO_SO, 00088 L1_CHO_CHOE, 00089 L1_YO_YING, 00090 L1_DO_CHADA, 00091 L1_TO_PATAK, 00092 L1_THO_THAN, 00093 L1_THO_NANGMONTHO, 00094 L1_THO_PHUTHAO, 00095 L1_NO_NEN, 00096 L1_DO_DEK, 00097 L1_TO_TAO, 00098 L1_THO_THUNG, 00099 L1_THO_THAHAN, 00100 L1_THO_THONG, 00101 L1_NO_NU, 00102 L1_BO_BAIMAI, 00103 L1_PO_PLA, 00104 L1_PHO_PHUNG, 00105 L1_FO_FA, 00106 L1_PHO_PHAN, 00107 L1_FO_FAN, 00108 L1_PHO_SAMPHAO, 00109 L1_MO_MA, 00110 L1_YO_YAK, 00111 L1_RO_RUA, 00112 L1_RU, 00113 L1_LO_LING, 00114 L1_LU, 00115 L1_WO_WAEN, 00116 L1_SO_SALA, 00117 L1_SO_RUSI, 00118 L1_SO_SUA, 00119 L1_HO_HIP, 00120 L1_LO_CHULA, 00121 L1_O_ANG, 00122 L1_HO_NOKHUK, 00123 L1_NKHIT, 00124 L1_SARA_A, 00125 L1_MAI_HAN_AKAT, 00126 L1_SARA_AA, 00127 L1_SARA_AM, 00128 L1_SARA_I, 00129 L1_SARA_II, 00130 L1_SARA_UE, 00131 L1_SARA_UEE, 00132 L1_SARA_U, 00133 L1_SARA_UU, 00134 L1_SARA_E, 00135 L1_SARA_AE, 00136 L1_SARA_O, 00137 L1_SARA_AI_MAIMUAN, 00138 L1_SARA_AI_MAIMALAI 00139 }; 00140 00141 /* level 2 symbols & order */ 00142 enum l2_symbols { 00143 L2_BLANK = TOT_LEVELS, 00144 L2_THAII, 00145 L2_YAMAK, 00146 L2_PINTHU, 00147 L2_GARAN, 00148 L2_TYKHU, 00149 L2_TONE1, 00150 L2_TONE2, 00151 L2_TONE3, 00152 L2_TONE4 00153 }; 00154 00155 /* level 3 symbols & order */ 00156 enum l3_symbols { 00157 L3_BLANK = TOT_LEVELS, 00158 L3_SPACE, 00159 L3_NB_SACE, 00160 L3_LOW_LINE, 00161 L3_HYPHEN, 00162 L3_COMMA, 00163 L3_SEMICOLON, 00164 L3_COLON, 00165 L3_EXCLAMATION, 00166 L3_QUESTION, 00167 L3_SOLIDUS, 00168 L3_FULL_STOP, 00169 L3_PAIYAN_NOI, 00170 L3_MAI_YAMOK, 00171 L3_GRAVE, 00172 L3_CIRCUMFLEX, 00173 L3_TILDE, 00174 L3_APOSTROPHE, 00175 L3_QUOTATION, 00176 L3_L_PARANTHESIS, 00177 L3_L_BRACKET, 00178 L3_L_BRACE, 00179 L3_R_BRACE, 00180 L3_R_BRACKET, 00181 L3_R_PARENTHESIS, 00182 L3_AT, 00183 L3_BAHT, 00184 L3_DOLLAR, 00185 L3_FONGMAN, 00186 L3_ANGKHANKHU, 00187 L3_KHOMUT, 00188 L3_ASTERISK, 00189 L3_BK_SOLIDUS, 00190 L3_AMPERSAND, 00191 L3_NUMBER, 00192 L3_PERCENT, 00193 L3_PLUS, 00194 L3_LESS_THAN, 00195 L3_EQUAL, 00196 L3_GREATER_THAN, 00197 L3_V_LINE 00198 }; 00199 00200 /* level 4 symbols & order */ 00201 enum l4_symbols { 00202 L4_BLANK = TOT_LEVELS, 00203 L4_MIN, 00204 L4_CAP, 00205 L4_EXT 00206 }; 00207 00208 enum level_symbols { 00209 L_UPRUPR = TOT_LEVELS, 00210 L_UPPER, 00211 L_MIDDLE, 00212 L_LOWER 00213 }; 00214 00215 #define _is(c) (t_ctype[(c)][LAST_LEVEL]) 00216 #define _level 8 00217 #define _consnt 16 00218 #define _ldvowel 32 00219 #define _fllwvowel 64 00220 #define _uprvowel 128 00221 #define _lwrvowel 256 00222 #define _tone 512 00223 #define _diacrt1 1024 00224 #define _diacrt2 2048 00225 #define _combine 4096 00226 #define _stone 8192 00227 #define _tdig 16384 00228 #define _rearvowel (_fllwvowel | _uprvowel | _lwrvowel) 00229 #define _diacrt (_diacrt1 | _diacrt2) 00230 #define levelof(c) ( _is(c) & _level ) 00231 #define isthai(c) ( (c) >= 128 ) 00232 #define istalpha(c) ( _is(c) & (_consnt|_ldvowel|_rearvowel|\ 00233 _tone|_diacrt1|_diacrt2) ) 00234 #define isconsnt(c) ( _is(c) & _consnt ) 00235 #define isldvowel(c) ( _is(c) & _ldvowel ) 00236 #define isfllwvowel(c) ( _is(c) & _fllwvowel ) 00237 #define ismidvowel(c) ( _is(c) & (_ldvowel|_fllwvowel) ) 00238 #define isuprvowel(c) ( _is(c) & _uprvowel ) 00239 #define islwrvowel(c) ( _is(c) & _lwrvowel ) 00240 #define isuprlwrvowel(c) ( _is(c) & (_lwrvowel | _uprvowel)) 00241 #define isrearvowel(c) ( _is(c) & _rearvowel ) 00242 #define isvowel(c) ( _is(c) & (_ldvowel|_rearvowel) ) 00243 #define istone(c) ( _is(c) & _tone ) 00244 #define isunldable(c) ( _is(c) & (_rearvowel|_tone|_diacrt1|_diacrt2) ) 00245 #define iscombinable(c) ( _is(c) & _combine ) 00246 #define istdigit(c) ( _is(c) & _tdig ) 00247 #define isstone(c) ( _is(c) & _stone ) 00248 #define isdiacrt1(c) ( _is(c) & _diacrt1) 00249 #define isdiacrt2(c) ( _is(c) & _diacrt2) 00250 #define isdiacrt(c) ( _is(c) & _diacrt) 00251 00252 /* Function prototype called by sql/field.cc */ 00253 void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length); 00254 00255 #endif