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