1
by brian
clean slate |
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
15 |
||
16 |
/*
|
|
17 |
A better inplementation of the UNIX ctype(3) library.
|
|
18 |
*/
|
|
19 |
||
1241.9.61
by Monty Taylor
No more mystrings in drizzled/ |
20 |
#ifndef DRIZZLED_CHARSET_INFO_H
|
21 |
#define DRIZZLED_CHARSET_INFO_H
|
|
1
by brian
clean slate |
22 |
|
612.2.4
by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere. |
23 |
#include <sys/types.h> |
548
by Monty Taylor
Moved my_handler to myisam, which is where it actually belongs. |
24 |
|
1
by brian
clean slate |
25 |
#ifdef __cplusplus
|
26 |
extern "C" { |
|
27 |
#endif
|
|
28 |
||
29 |
#define MY_CS_NAME_SIZE 32
|
|
30 |
#define MY_CS_CTYPE_TABLE_SIZE 257
|
|
31 |
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
|
32 |
#define MY_CS_TO_UPPER_TABLE_SIZE 256
|
|
33 |
#define MY_CS_SORT_ORDER_TABLE_SIZE 256
|
|
34 |
#define MY_CS_TO_UNI_TABLE_SIZE 256
|
|
35 |
||
36 |
#define CHARSET_DIR "charsets/"
|
|
37 |
||
612.2.4
by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere. |
38 |
#define my_wc_t unsigned long
|
1
by brian
clean slate |
39 |
|
40 |
typedef struct unicase_info_st |
|
41 |
{
|
|
206
by Brian Aker
Removed final uint dead types. |
42 |
uint16_t toupper; |
43 |
uint16_t tolower; |
|
44 |
uint16_t sort; |
|
1
by brian
clean slate |
45 |
} MY_UNICASE_INFO; |
46 |
||
47 |
||
48 |
extern MY_UNICASE_INFO *my_unicase_default[256]; |
|
49 |
extern MY_UNICASE_INFO *my_unicase_turkish[256]; |
|
50 |
||
51 |
typedef struct uni_ctype_st |
|
52 |
{
|
|
481
by Brian Aker
Remove all of uchar. |
53 |
unsigned char pctype; |
54 |
unsigned char *ctype; |
|
1
by brian
clean slate |
55 |
} MY_UNI_CTYPE; |
56 |
||
57 |
extern MY_UNI_CTYPE my_uni_ctype[256]; |
|
58 |
||
59 |
/* wm_wc and wc_mb return codes */
|
|
60 |
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ |
|
61 |
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ |
|
62 |
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ |
|
63 |
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ |
|
64 |
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ |
|
65 |
/* These following three are currently not really used */
|
|
66 |
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ |
|
67 |
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ |
|
68 |
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ |
|
69 |
/* A helper macros for "need at least n bytes" */
|
|
70 |
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
|
71 |
||
72 |
#define MY_SEQ_INTTAIL 1
|
|
73 |
#define MY_SEQ_SPACES 2
|
|
74 |
||
75 |
/* My charsets_list flags */
|
|
76 |
#define MY_CS_COMPILED 1 /* compiled-in sets */ |
|
77 |
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */ |
|
78 |
#define MY_CS_INDEX 4 /* sets listed in the Index file */ |
|
79 |
#define MY_CS_LOADED 8 /* sets that are currently loaded */ |
|
80 |
#define MY_CS_BINSORT 16 /* if binary sort order */ |
|
81 |
#define MY_CS_PRIMARY 32 /* if primary collation */ |
|
82 |
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ |
|
83 |
#define MY_CS_UNICODE 128 /* is a charset is full unicode */ |
|
84 |
#define MY_CS_READY 256 /* if a charset is initialized */ |
|
85 |
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
86 |
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ |
87 |
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */ |
|
1
by brian
clean slate |
88 |
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ |
89 |
#define MY_CHARSET_UNDEFINED 0
|
|
90 |
||
91 |
/* Flags for strxfrm */
|
|
92 |
#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */ |
|
93 |
#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */ |
|
94 |
#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */ |
|
95 |
#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */ |
|
96 |
#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */ |
|
97 |
#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */ |
|
98 |
#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */ |
|
99 |
#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/ |
|
100 |
||
101 |
#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */ |
|
102 |
#define MY_STRXFRM_UNUSED_00000080 0x00000080 /* for future extensions */ |
|
103 |
||
104 |
#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */ |
|
105 |
#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */ |
|
106 |
#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */ |
|
107 |
#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */ |
|
108 |
#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */ |
|
109 |
#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */ |
|
110 |
#define MY_STRXFRM_DESC_SHIFT 8
|
|
111 |
||
112 |
#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */ |
|
113 |
#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */ |
|
114 |
||
115 |
#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */ |
|
116 |
#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */ |
|
117 |
#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */ |
|
118 |
#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */ |
|
119 |
#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */ |
|
120 |
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ |
|
121 |
#define MY_STRXFRM_REVERSE_SHIFT 16
|
|
122 |
||
123 |
||
124 |
typedef struct my_uni_idx_st |
|
125 |
{
|
|
206
by Brian Aker
Removed final uint dead types. |
126 |
uint16_t from; |
127 |
uint16_t to; |
|
481
by Brian Aker
Remove all of uchar. |
128 |
unsigned char *tab; |
1
by brian
clean slate |
129 |
} MY_UNI_IDX; |
130 |
||
131 |
typedef struct |
|
132 |
{
|
|
411
by Brian Aker
Removed legacy bits around enum. |
133 |
uint32_t beg; |
134 |
uint32_t end; |
|
135 |
uint32_t mb_len; |
|
1
by brian
clean slate |
136 |
} my_match_t; |
137 |
||
138 |
enum my_lex_states |
|
139 |
{
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
140 |
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, |
1
by brian
clean slate |
141 |
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, |
142 |
MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER, |
|
143 |
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, |
|
144 |
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
145 |
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, |
146 |
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, |
|
147 |
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, |
|
1
by brian
clean slate |
148 |
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, |
149 |
MY_LEX_IDENT_OR_KEYWORD, |
|
235
by Brian Aker
Final bit of NCHAR removed. |
150 |
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, |
1
by brian
clean slate |
151 |
MY_LEX_STRING_OR_DELIMITER
|
152 |
};
|
|
153 |
||
154 |
struct charset_info_st; |
|
155 |
||
156 |
||
157 |
/* See strings/CHARSET_INFO.txt for information about this structure */
|
|
158 |
typedef struct my_collation_handler_st |
|
159 |
{
|
|
276
by Brian Aker
Cleaned out my_bool from strings. |
160 |
bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); |
1
by brian
clean slate |
161 |
/* Collation routines */
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
162 |
int (*strnncoll)(const struct charset_info_st * const, |
481
by Brian Aker
Remove all of uchar. |
163 |
const unsigned char *, size_t, const unsigned char *, size_t, bool); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
164 |
int (*strnncollsp)(const struct charset_info_st * const, |
481
by Brian Aker
Remove all of uchar. |
165 |
const unsigned char *, size_t, const unsigned char *, size_t, |
276
by Brian Aker
Cleaned out my_bool from strings. |
166 |
bool diff_if_only_endspace_difference); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
167 |
size_t (*strnxfrm)(const struct charset_info_st * const, |
481
by Brian Aker
Remove all of uchar. |
168 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
169 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
170 |
size_t (*strnxfrmlen)(const struct charset_info_st * const, size_t); |
276
by Brian Aker
Cleaned out my_bool from strings. |
171 |
bool (*like_range)(const struct charset_info_st * const, |
77.1.95
by Monty Taylor
Fixed silly my_bool==char nonsense. |
172 |
const char *s, size_t s_length, |
173 |
char escape, char w_one, char w_many, |
|
174 |
size_t res_length, |
|
175 |
char *min_str, char *max_str, |
|
176 |
size_t *min_len, size_t *max_len); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
177 |
int (*wildcmp)(const struct charset_info_st * const, |
1
by brian
clean slate |
178 |
const char *str,const char *str_end, |
179 |
const char *wildstr,const char *wildend, |
|
180 |
int escape,int w_one, int w_many); |
|
181 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
182 |
int (*strcasecmp)(const struct charset_info_st * const, const char *, const char *); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
183 |
|
411
by Brian Aker
Removed legacy bits around enum. |
184 |
uint32_t (*instr)(const struct charset_info_st * const, |
1
by brian
clean slate |
185 |
const char *b, size_t b_length, |
186 |
const char *s, size_t s_length, |
|
411
by Brian Aker
Removed legacy bits around enum. |
187 |
my_match_t *match, uint32_t nmatch); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
188 |
|
1
by brian
clean slate |
189 |
/* Hash calculation */
|
481
by Brian Aker
Remove all of uchar. |
190 |
void (*hash_sort)(const struct charset_info_st *cs, const unsigned char *key, size_t len, |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
191 |
uint32_t *nr1, uint32_t *nr2); |
481
by Brian Aker
Remove all of uchar. |
192 |
bool (*propagate)(const struct charset_info_st *cs, const unsigned char *str, size_t len); |
1
by brian
clean slate |
193 |
} MY_COLLATION_HANDLER; |
194 |
||
195 |
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; |
|
196 |
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; |
|
197 |
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; |
|
198 |
||
199 |
/* Some typedef to make it easy for C++ to make function pointers */
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
200 |
typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st * const, my_wc_t *, |
481
by Brian Aker
Remove all of uchar. |
201 |
const unsigned char *, const unsigned char *); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
202 |
typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st * const, my_wc_t, |
481
by Brian Aker
Remove all of uchar. |
203 |
unsigned char *, unsigned char *); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
204 |
typedef size_t (*my_charset_conv_case)(const struct charset_info_st * const, |
1
by brian
clean slate |
205 |
char *, size_t, char *, size_t); |
206 |
||
207 |
||
208 |
/* See strings/CHARSET_INFO.txt about information on this structure */
|
|
209 |
typedef struct my_charset_handler_st |
|
210 |
{
|
|
276
by Brian Aker
Cleaned out my_bool from strings. |
211 |
bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); |
1
by brian
clean slate |
212 |
/* Multibyte routines */
|
411
by Brian Aker
Removed legacy bits around enum. |
213 |
uint32_t (*ismbchar)(const struct charset_info_st * const, const char *, const char *); |
214 |
uint32_t (*mbcharlen)(const struct charset_info_st * const, uint32_t c); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
215 |
size_t (*numchars)(const struct charset_info_st * const, const char *b, const char *e); |
216 |
size_t (*charpos)(const struct charset_info_st * const, const char *b, const char *e, |
|
1
by brian
clean slate |
217 |
size_t pos); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
218 |
size_t (*well_formed_len)(const struct charset_info_st * const, |
1
by brian
clean slate |
219 |
const char *b,const char *e, |
220 |
size_t nchars, int *error); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
221 |
size_t (*lengthsp)(const struct charset_info_st * const, const char *ptr, size_t length); |
222 |
size_t (*numcells)(const struct charset_info_st * const, const char *b, const char *e); |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
223 |
|
1
by brian
clean slate |
224 |
/* Unicode conversion */
|
225 |
my_charset_conv_mb_wc mb_wc; |
|
226 |
my_charset_conv_wc_mb wc_mb; |
|
227 |
||
228 |
/* CTYPE scanner */
|
|
236.3.9
by Andrey Hristov
- Fix build of exotic, mostly non-western, charsets (--with-extra-charsets) |
229 |
int (*ctype)(const struct charset_info_st *cs, int *ctype, |
481
by Brian Aker
Remove all of uchar. |
230 |
const unsigned char *s, const unsigned char *e); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
231 |
|
1
by brian
clean slate |
232 |
/* Functions for case and sort conversion */
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
233 |
size_t (*caseup_str)(const struct charset_info_st * const, char *); |
234 |
size_t (*casedn_str)(const struct charset_info_st * const, char *); |
|
1
by brian
clean slate |
235 |
|
236 |
my_charset_conv_case caseup; |
|
237 |
my_charset_conv_case casedn; |
|
238 |
||
239 |
/* Charset dependant snprintf() */
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
240 |
size_t (*snprintf)(const struct charset_info_st * const, char *to, size_t n, |
1
by brian
clean slate |
241 |
const char *fmt, |
212.5.26
by Monty Taylor
Removed my_attribute. Renaming __attribute__((format(x,y,z))) to ATTRIBUTE_FORMAT(x,y,z) is retarded. So we don't do it anymore. |
242 |
...) __attribute__((format(printf, 4, 5))); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
243 |
size_t (*long10_to_str)(const struct charset_info_st * const, char *to, size_t n, |
1
by brian
clean slate |
244 |
int radix, long int val); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
245 |
size_t (*int64_t10_to_str)(const struct charset_info_st * const, char *to, size_t n, |
152
by Brian Aker
longlong replacement |
246 |
int radix, int64_t val); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
247 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
248 |
void (*fill)(const struct charset_info_st * const, char *to, size_t len, int fill); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
249 |
|
1
by brian
clean slate |
250 |
/* String-to-number conversion routines */
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
251 |
long (*strntol)(const struct charset_info_st * const, const char *s, size_t l, |
252 |
int base, char **e, int *err); |
|
612.2.4
by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere. |
253 |
unsigned long (*strntoul)(const struct charset_info_st * const, const char *s, size_t l, |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
254 |
int base, char **e, int *err); |
255 |
int64_t (*strntoll)(const struct charset_info_st * const, const char *s, size_t l, |
|
256 |
int base, char **e, int *err); |
|
257 |
uint64_t (*strntoull)(const struct charset_info_st * const, const char *s, size_t l, |
|
258 |
int base, char **e, int *err); |
|
259 |
double (*strntod)(const struct charset_info_st * const, char *s, size_t l, char **e, |
|
1
by brian
clean slate |
260 |
int *err); |
236.3.9
by Andrey Hristov
- Fix build of exotic, mostly non-western, charsets (--with-extra-charsets) |
261 |
int64_t (*strtoll10)(const struct charset_info_st *cs, |
1
by brian
clean slate |
262 |
const char *nptr, char **endptr, int *error); |
236.3.9
by Andrey Hristov
- Fix build of exotic, mostly non-western, charsets (--with-extra-charsets) |
263 |
uint64_t (*strntoull10rnd)(const struct charset_info_st *cs, |
1
by brian
clean slate |
264 |
const char *str, size_t length, |
265 |
int unsigned_fl, |
|
266 |
char **endptr, int *error); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
267 |
size_t (*scan)(const struct charset_info_st * const, const char *b, const char *e, |
1
by brian
clean slate |
268 |
int sq); |
269 |
} MY_CHARSET_HANDLER; |
|
270 |
||
271 |
extern MY_CHARSET_HANDLER my_charset_8bit_handler; |
|
272 |
extern MY_CHARSET_HANDLER my_charset_ucs2_handler; |
|
273 |
||
274 |
||
275 |
/* See strings/CHARSET_INFO.txt about information on this structure */
|
|
276 |
typedef struct charset_info_st |
|
277 |
{
|
|
411
by Brian Aker
Removed legacy bits around enum. |
278 |
uint32_t number; |
279 |
uint32_t primary_number; |
|
280 |
uint32_t binary_number; |
|
281 |
uint32_t state; |
|
1
by brian
clean slate |
282 |
const char *csname; |
283 |
const char *name; |
|
284 |
const char *comment; |
|
285 |
const char *tailoring; |
|
481
by Brian Aker
Remove all of uchar. |
286 |
unsigned char *ctype; |
287 |
unsigned char *to_lower; |
|
288 |
unsigned char *to_upper; |
|
289 |
unsigned char *sort_order; |
|
206
by Brian Aker
Removed final uint dead types. |
290 |
uint16_t *contractions; |
291 |
uint16_t **sort_order_big; |
|
292 |
uint16_t *tab_to_uni; |
|
1
by brian
clean slate |
293 |
MY_UNI_IDX *tab_from_uni; |
294 |
MY_UNICASE_INFO **caseinfo; |
|
481
by Brian Aker
Remove all of uchar. |
295 |
unsigned char *state_map; |
296 |
unsigned char *ident_map; |
|
411
by Brian Aker
Removed legacy bits around enum. |
297 |
uint32_t strxfrm_multiply; |
481
by Brian Aker
Remove all of uchar. |
298 |
unsigned char caseup_multiply; |
299 |
unsigned char casedn_multiply; |
|
411
by Brian Aker
Removed legacy bits around enum. |
300 |
uint32_t mbminlen; |
301 |
uint32_t mbmaxlen; |
|
206
by Brian Aker
Removed final uint dead types. |
302 |
uint16_t min_sort_char; |
303 |
uint16_t max_sort_char; /* For LIKE optimization */ |
|
481
by Brian Aker
Remove all of uchar. |
304 |
unsigned char pad_char; |
276
by Brian Aker
Cleaned out my_bool from strings. |
305 |
bool escape_with_backslash_is_dangerous; |
481
by Brian Aker
Remove all of uchar. |
306 |
unsigned char levels_for_compare; |
307 |
unsigned char levels_for_order; |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
308 |
|
1
by brian
clean slate |
309 |
MY_CHARSET_HANDLER *cset; |
310 |
MY_COLLATION_HANDLER *coll; |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
311 |
|
1
by brian
clean slate |
312 |
} CHARSET_INFO; |
520.6.7
by Monty Taylor
Moved a bunch of crap out of common_includes. |
313 |
|
365.2.9
by Monty Taylor
Got rid of all instances of ~0 |
314 |
#define ILLEGAL_CHARSET_INFO_NUMBER (UINT32_MAX)
|
1
by brian
clean slate |
315 |
|
316 |
||
317 |
extern CHARSET_INFO my_charset_bin; |
|
318 |
extern CHARSET_INFO my_charset_utf8mb4_bin; |
|
319 |
extern CHARSET_INFO my_charset_utf8mb4_general_ci; |
|
320 |
extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; |
|
321 |
||
322 |
#define MY_UTF8MB4 "utf8"
|
|
323 |
#define my_charset_utf8_general_ci my_charset_utf8mb4_general_ci
|
|
324 |
#define my_charset_utf8_bin my_charset_utf8mb4_bin
|
|
325 |
||
326 |
||
327 |
/* declarations for simple charsets */
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
328 |
size_t my_strnxfrmlen_simple(const CHARSET_INFO * const, size_t); |
1
by brian
clean slate |
329 |
|
481
by Brian Aker
Remove all of uchar. |
330 |
extern int my_strnncollsp_simple(const CHARSET_INFO * const, const unsigned char *, size_t, |
331 |
const unsigned char *, size_t, |
|
276
by Brian Aker
Cleaned out my_bool from strings. |
332 |
bool diff_if_only_endspace_difference); |
1
by brian
clean slate |
333 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
334 |
extern size_t my_lengthsp_8bit(const CHARSET_INFO * const cs, const char *ptr, size_t length); |
1
by brian
clean slate |
335 |
|
411
by Brian Aker
Removed legacy bits around enum. |
336 |
extern uint32_t my_instr_simple(const CHARSET_INFO * const, |
1
by brian
clean slate |
337 |
const char *b, size_t b_length, |
338 |
const char *s, size_t s_length, |
|
411
by Brian Aker
Removed legacy bits around enum. |
339 |
my_match_t *match, uint32_t nmatch); |
1
by brian
clean slate |
340 |
|
341 |
||
342 |
/* Functions for 8bit */
|
|
481
by Brian Aker
Remove all of uchar. |
343 |
int my_mb_ctype_8bit(const CHARSET_INFO * const,int *, const unsigned char *,const unsigned char *); |
344 |
int my_mb_ctype_mb(const CHARSET_INFO * const,int *, const unsigned char *,const unsigned char *); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
345 |
|
346 |
size_t my_scan_8bit(const CHARSET_INFO * const cs, const char *b, const char *e, int sq); |
|
347 |
||
348 |
size_t my_snprintf_8bit(const CHARSET_INFO * const, char *to, size_t n, |
|
1
by brian
clean slate |
349 |
const char *fmt, ...) |
212.5.26
by Monty Taylor
Removed my_attribute. Renaming __attribute__((format(x,y,z))) to ATTRIBUTE_FORMAT(x,y,z) is retarded. So we don't do it anymore. |
350 |
__attribute__((format(printf, 4, 5))); |
1
by brian
clean slate |
351 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
352 |
long my_strntol_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base, |
1
by brian
clean slate |
353 |
char **e, int *err); |
612.2.4
by Monty Taylor
Moved some defines to config.h. Stopped including config.h directly anywhere. |
354 |
unsigned long my_strntoul_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base, |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
355 |
char **e, int *err); |
356 |
int64_t my_strntoll_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base, |
|
357 |
char **e, int *err); |
|
358 |
uint64_t my_strntoull_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base, |
|
359 |
char **e, int *err); |
|
360 |
double my_strntod_8bit(const CHARSET_INFO * const, char *s, size_t l,char **e, |
|
1
by brian
clean slate |
361 |
int *err); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
362 |
size_t my_long10_to_str_8bit(const CHARSET_INFO * const, char *to, size_t l, int radix, |
1
by brian
clean slate |
363 |
long int val); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
364 |
size_t my_int64_t10_to_str_8bit(const CHARSET_INFO * const, char *to, size_t l, int radix, |
152
by Brian Aker
longlong replacement |
365 |
int64_t val); |
1
by brian
clean slate |
366 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
367 |
int64_t my_strtoll10_8bit(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
368 |
const char *nptr, char **endptr, int *error); |
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
369 |
int64_t my_strtoll10_ucs2(CHARSET_INFO *cs, |
1
by brian
clean slate |
370 |
const char *nptr, char **endptr, int *error); |
371 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
372 |
uint64_t my_strntoull10rnd_8bit(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
373 |
const char *str, size_t length, int |
374 |
unsigned_fl, char **endptr, int *error); |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
375 |
uint64_t my_strntoull10rnd_ucs2(CHARSET_INFO *cs, |
1
by brian
clean slate |
376 |
const char *str, size_t length, |
377 |
int unsigned_fl, char **endptr, int *error); |
|
378 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
379 |
void my_fill_8bit(const CHARSET_INFO * const cs, char* to, size_t l, int fill); |
1
by brian
clean slate |
380 |
|
276
by Brian Aker
Cleaned out my_bool from strings. |
381 |
bool my_like_range_simple(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
382 |
const char *ptr, size_t ptr_length, |
77.1.95
by Monty Taylor
Fixed silly my_bool==char nonsense. |
383 |
char escape, char w_one, char w_many, |
1
by brian
clean slate |
384 |
size_t res_length, |
385 |
char *min_str, char *max_str, |
|
386 |
size_t *min_length, size_t *max_length); |
|
387 |
||
276
by Brian Aker
Cleaned out my_bool from strings. |
388 |
bool my_like_range_mb(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
389 |
const char *ptr, size_t ptr_length, |
77.1.95
by Monty Taylor
Fixed silly my_bool==char nonsense. |
390 |
char escape, char w_one, char w_many, |
1
by brian
clean slate |
391 |
size_t res_length, |
392 |
char *min_str, char *max_str, |
|
393 |
size_t *min_length, size_t *max_length); |
|
394 |
||
276
by Brian Aker
Cleaned out my_bool from strings. |
395 |
bool my_like_range_ucs2(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
396 |
const char *ptr, size_t ptr_length, |
77.1.95
by Monty Taylor
Fixed silly my_bool==char nonsense. |
397 |
char escape, char w_one, char w_many, |
1
by brian
clean slate |
398 |
size_t res_length, |
399 |
char *min_str, char *max_str, |
|
400 |
size_t *min_length, size_t *max_length); |
|
401 |
||
276
by Brian Aker
Cleaned out my_bool from strings. |
402 |
bool my_like_range_utf16(const CHARSET_INFO * const cs, |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
403 |
const char *ptr, size_t ptr_length, |
404 |
char escape, char w_one, char w_many, |
|
405 |
size_t res_length, |
|
406 |
char *min_str, char *max_str, |
|
407 |
size_t *min_length, size_t *max_length); |
|
408 |
||
276
by Brian Aker
Cleaned out my_bool from strings. |
409 |
bool my_like_range_utf32(const CHARSET_INFO * const cs, |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
410 |
const char *ptr, size_t ptr_length, |
411 |
char escape, char w_one, char w_many, |
|
412 |
size_t res_length, |
|
413 |
char *min_str, char *max_str, |
|
414 |
size_t *min_length, size_t *max_length); |
|
415 |
||
416 |
||
417 |
int my_wildcmp_8bit(const CHARSET_INFO * const, |
|
1
by brian
clean slate |
418 |
const char *str,const char *str_end, |
419 |
const char *wildstr,const char *wildend, |
|
420 |
int escape, int w_one, int w_many); |
|
421 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
422 |
int my_wildcmp_bin(const CHARSET_INFO * const, |
1
by brian
clean slate |
423 |
const char *str,const char *str_end, |
424 |
const char *wildstr,const char *wildend, |
|
425 |
int escape, int w_one, int w_many); |
|
426 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
427 |
size_t my_numchars_8bit(const CHARSET_INFO * const, const char *b, const char *e); |
428 |
size_t my_numcells_8bit(const CHARSET_INFO * const, const char *b, const char *e); |
|
429 |
size_t my_charpos_8bit(const CHARSET_INFO * const, const char *b, const char *e, size_t pos); |
|
430 |
size_t my_well_formed_len_8bit(const CHARSET_INFO * const, const char *b, const char *e, |
|
1
by brian
clean slate |
431 |
size_t pos, int *error); |
632.1.10
by Monty Taylor
Got rid of Sun Studio warnings. |
432 |
typedef void *(*cs_alloc_func)(size_t); |
433 |
bool my_coll_init_simple(CHARSET_INFO *cs, cs_alloc_func alloc); |
|
434 |
bool my_cset_init_8bit(CHARSET_INFO *cs, cs_alloc_func alloc); |
|
411
by Brian Aker
Removed legacy bits around enum. |
435 |
uint32_t my_mbcharlen_8bit(const CHARSET_INFO * const, uint32_t c); |
1
by brian
clean slate |
436 |
|
437 |
||
438 |
/* Functions for multibyte charsets */
|
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
439 |
extern size_t my_caseup_str_mb(const CHARSET_INFO * const, char *); |
440 |
extern size_t my_casedn_str_mb(const CHARSET_INFO * const, char *); |
|
441 |
extern size_t my_caseup_mb(const CHARSET_INFO * const, char *src, size_t srclen, |
|
442 |
char *dst, size_t dstlen); |
|
443 |
extern size_t my_casedn_mb(const CHARSET_INFO * const, char *src, size_t srclen, |
|
444 |
char *dst, size_t dstlen); |
|
445 |
extern int my_strcasecmp_mb(const CHARSET_INFO * const cs, const char *s, const char *t); |
|
1
by brian
clean slate |
446 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
447 |
int my_wildcmp_mb(const CHARSET_INFO * const, |
1
by brian
clean slate |
448 |
const char *str,const char *str_end, |
449 |
const char *wildstr,const char *wildend, |
|
450 |
int escape, int w_one, int w_many); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
451 |
size_t my_numchars_mb(const CHARSET_INFO * const, const char *b, const char *e); |
452 |
size_t my_numcells_mb(const CHARSET_INFO * const, const char *b, const char *e); |
|
453 |
size_t my_charpos_mb(const CHARSET_INFO * const, const char *b, const char *e, size_t pos); |
|
454 |
size_t my_well_formed_len_mb(const CHARSET_INFO * const, const char *b, const char *e, |
|
1
by brian
clean slate |
455 |
size_t pos, int *error); |
411
by Brian Aker
Removed legacy bits around enum. |
456 |
uint32_t my_instr_mb(const CHARSET_INFO * const, |
1
by brian
clean slate |
457 |
const char *b, size_t b_length, |
458 |
const char *s, size_t s_length, |
|
411
by Brian Aker
Removed legacy bits around enum. |
459 |
my_match_t *match, uint32_t nmatch); |
1
by brian
clean slate |
460 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
461 |
int my_strnncoll_mb_bin(const CHARSET_INFO * const cs, |
481
by Brian Aker
Remove all of uchar. |
462 |
const unsigned char *s, size_t slen, |
463 |
const unsigned char *t, size_t tlen, |
|
276
by Brian Aker
Cleaned out my_bool from strings. |
464 |
bool t_is_prefix); |
1
by brian
clean slate |
465 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
466 |
int my_strnncollsp_mb_bin(const CHARSET_INFO * const cs, |
481
by Brian Aker
Remove all of uchar. |
467 |
const unsigned char *a, size_t a_length, |
468 |
const unsigned char *b, size_t b_length, |
|
276
by Brian Aker
Cleaned out my_bool from strings. |
469 |
bool diff_if_only_endspace_difference); |
1
by brian
clean slate |
470 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
471 |
int my_wildcmp_mb_bin(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
472 |
const char *str,const char *str_end, |
473 |
const char *wildstr,const char *wildend, |
|
474 |
int escape, int w_one, int w_many); |
|
475 |
||
647
by Brian Aker
Clean up of code for Solaris (removed dead lock call). |
476 |
int my_strcasecmp_mb_bin(const CHARSET_INFO * const, const char *s, const char *t); |
1
by brian
clean slate |
477 |
|
647
by Brian Aker
Clean up of code for Solaris (removed dead lock call). |
478 |
void my_hash_sort_mb_bin(const CHARSET_INFO *, |
481
by Brian Aker
Remove all of uchar. |
479 |
const unsigned char *key, size_t len, uint32_t *nr1, uint32_t *nr2); |
1
by brian
clean slate |
480 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
481 |
size_t my_strnxfrm_mb(const CHARSET_INFO * const, |
481
by Brian Aker
Remove all of uchar. |
482 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
483 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
1
by brian
clean slate |
484 |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
485 |
int my_wildcmp_unicode(const CHARSET_INFO * const cs, |
1
by brian
clean slate |
486 |
const char *str, const char *str_end, |
487 |
const char *wildstr, const char *wildend, |
|
488 |
int escape, int w_one, int w_many, |
|
489 |
MY_UNICASE_INFO **weights); |
|
490 |
||
276
by Brian Aker
Cleaned out my_bool from strings. |
491 |
extern bool my_parse_charset_xml(const char *bug, size_t len, |
1
by brian
clean slate |
492 |
int (*add)(CHARSET_INFO *cs)); |
493 |
||
481
by Brian Aker
Remove all of uchar. |
494 |
bool my_propagate_simple(const CHARSET_INFO * const cs, const unsigned char *str, size_t len); |
495 |
bool my_propagate_complex(const CHARSET_INFO * const cs, const unsigned char *str, size_t len); |
|
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
496 |
|
497 |
||
411
by Brian Aker
Removed legacy bits around enum. |
498 |
uint32_t my_strxfrm_flag_normalize(uint32_t flags, uint32_t nlevels); |
481
by Brian Aker
Remove all of uchar. |
499 |
void my_strxfrm_desc_and_reverse(unsigned char *str, unsigned char *strend, |
411
by Brian Aker
Removed legacy bits around enum. |
500 |
uint32_t flags, uint32_t level); |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
501 |
size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO * const cs, |
481
by Brian Aker
Remove all of uchar. |
502 |
unsigned char *str, unsigned char *frmend, unsigned char *strend, |
411
by Brian Aker
Removed legacy bits around enum. |
503 |
uint32_t nweights, uint32_t flags, uint32_t level); |
1
by brian
clean slate |
504 |
|
276
by Brian Aker
Cleaned out my_bool from strings. |
505 |
bool my_charset_is_ascii_compatible(const CHARSET_INFO * const cs); |
1
by brian
clean slate |
506 |
|
632.1.10
by Monty Taylor
Got rid of Sun Studio warnings. |
507 |
/*
|
508 |
Compare 0-terminated UTF8 strings.
|
|
509 |
||
510 |
SYNOPSIS
|
|
511 |
my_strcasecmp_utf8mb3()
|
|
512 |
cs character set handler
|
|
513 |
s First 0-terminated string to compare
|
|
514 |
t Second 0-terminated string to compare
|
|
515 |
||
516 |
IMPLEMENTATION
|
|
517 |
||
518 |
RETURN
|
|
519 |
- negative number if s < t
|
|
520 |
- positive number if s > t
|
|
521 |
- 0 is the strings are equal
|
|
522 |
*/
|
|
523 |
int
|
|
524 |
my_wc_mb_filename(const CHARSET_INFO * const, |
|
525 |
my_wc_t wc, unsigned char *s, unsigned char *e); |
|
526 |
||
527 |
int
|
|
528 |
my_mb_wc_filename(const CHARSET_INFO * const, |
|
529 |
my_wc_t *pwc, const unsigned char *s, const unsigned char *e); |
|
530 |
||
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
531 |
|
632.1.10
by Monty Taylor
Got rid of Sun Studio warnings. |
532 |
unsigned int my_ismbchar_utf8mb4(const CHARSET_INFO * const cs, const char *b, const char *e); |
533 |
unsigned int my_mbcharlen_utf8mb4(const CHARSET_INFO * const, uint32_t c); |
|
534 |
||
535 |
size_t my_strnxfrmlen_utf8mb4(const CHARSET_INFO * const, size_t len); |
|
536 |
size_t
|
|
537 |
my_strnxfrm_utf8mb4(const CHARSET_INFO * const cs, |
|
538 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
|
539 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
540 |
||
541 |
int
|
|
542 |
my_wildcmp_utf8mb4(const CHARSET_INFO * const cs, |
|
543 |
const char *str, const char *strend, |
|
544 |
const char *wildstr, const char *wildend, |
|
545 |
int escape, int w_one, int w_many); |
|
546 |
int
|
|
547 |
my_strnncollsp_utf8mb4(const CHARSET_INFO * const cs, |
|
548 |
const unsigned char *s, size_t slen, |
|
549 |
const unsigned char *t, size_t tlen, |
|
550 |
bool diff_if_only_endspace_difference); |
|
551 |
int my_strcasecmp_utf8mb4(const CHARSET_INFO * const cs, |
|
552 |
const char *s, const char *t); |
|
553 |
||
554 |
int
|
|
555 |
my_strnncoll_utf8mb4(const CHARSET_INFO * const cs, |
|
556 |
const unsigned char *s, size_t slen, |
|
557 |
const unsigned char *t, size_t tlen, |
|
558 |
bool t_is_prefix); |
|
559 |
||
560 |
int
|
|
561 |
my_mb_wc_utf8mb4(const CHARSET_INFO * const cs, |
|
562 |
my_wc_t * pwc, const unsigned char *s, const unsigned char *e); |
|
563 |
||
564 |
int
|
|
565 |
my_wc_mb_utf8mb4(const CHARSET_INFO * const cs, |
|
566 |
my_wc_t wc, unsigned char *r, unsigned char *e); |
|
567 |
||
568 |
size_t my_caseup_str_utf8mb4(const CHARSET_INFO * const cs, char *src); |
|
569 |
size_t my_casedn_str_utf8mb4(const CHARSET_INFO * const cs, char *src); |
|
570 |
||
571 |
size_t
|
|
572 |
my_caseup_utf8mb4(const CHARSET_INFO * const cs, char *src, size_t srclen, |
|
573 |
char *dst, size_t dstlen); |
|
574 |
size_t
|
|
575 |
my_casedn_utf8mb4(const CHARSET_INFO * const cs, |
|
576 |
char *src, size_t srclen, |
|
577 |
char *dst, size_t dstlen); |
|
578 |
||
579 |
||
580 |
bool my_coll_init_uca(CHARSET_INFO *cs, cs_alloc_func alloc); |
|
581 |
||
582 |
int my_strnncoll_any_uca(const CHARSET_INFO * const cs, |
|
583 |
const unsigned char *s, size_t slen, |
|
584 |
const unsigned char *t, size_t tlen, |
|
585 |
bool t_is_prefix); |
|
586 |
||
587 |
int my_strnncollsp_any_uca(const CHARSET_INFO * const cs, |
|
588 |
const unsigned char *s, size_t slen, |
|
589 |
const unsigned char *t, size_t tlen, |
|
590 |
bool diff_if_only_endspace_difference); |
|
591 |
||
592 |
void my_hash_sort_any_uca(const CHARSET_INFO * const cs, |
|
593 |
const unsigned char *s, size_t slen, |
|
594 |
uint32_t *n1, uint32_t *n2); |
|
595 |
||
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
596 |
size_t my_strnxfrm_any_uca(const CHARSET_INFO * const cs, |
632.1.10
by Monty Taylor
Got rid of Sun Studio warnings. |
597 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
598 |
const unsigned char *src, size_t srclen, |
|
599 |
uint32_t flags); |
|
600 |
||
601 |
int my_wildcmp_uca(const CHARSET_INFO * const cs, |
|
602 |
const char *str,const char *str_end, |
|
603 |
const char *wildstr,const char *wildend, |
|
604 |
int escape, int w_one, int w_many); |
|
605 |
||
606 |
int my_strnncoll_8bit_bin(const CHARSET_INFO * const, |
|
607 |
const unsigned char *s, size_t slen, |
|
608 |
const unsigned char *t, size_t tlen, |
|
609 |
bool t_is_prefix); |
|
610 |
int my_strnncollsp_8bit_bin(const CHARSET_INFO * const, |
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
611 |
const unsigned char *a, size_t a_length, |
632.1.10
by Monty Taylor
Got rid of Sun Studio warnings. |
612 |
const unsigned char *b, size_t b_length, |
613 |
bool diff_if_only_endspace_difference); |
|
614 |
size_t my_case_str_bin(const CHARSET_INFO * const, char *); |
|
615 |
size_t my_case_bin(const CHARSET_INFO * const, char *, |
|
616 |
size_t srclen, char *, size_t); |
|
617 |
int my_strcasecmp_bin(const CHARSET_INFO * const, |
|
618 |
const char *s, const char *t); |
|
619 |
size_t
|
|
620 |
my_strnxfrm_8bit_bin(const CHARSET_INFO * const cs, |
|
621 |
unsigned char * dst, size_t dstlen, uint32_t nweights, |
|
622 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
623 |
uint32_t my_instr_bin(const CHARSET_INFO * const, |
|
624 |
const char *b, size_t b_length, |
|
625 |
const char *s, size_t s_length, |
|
626 |
my_match_t *match, uint32_t nmatch); |
|
627 |
size_t my_lengthsp_binary(const CHARSET_INFO * const, |
|
628 |
const char *, size_t length); |
|
629 |
int my_mb_wc_bin(const CHARSET_INFO * const, |
|
630 |
my_wc_t *wc, const unsigned char *str, |
|
631 |
const unsigned char *end); |
|
632 |
int my_wc_mb_bin(const CHARSET_INFO * const, my_wc_t wc, |
|
633 |
unsigned char *str, unsigned char *end); |
|
634 |
void my_hash_sort_8bit_bin(const CHARSET_INFO * const, |
|
635 |
const unsigned char *key, size_t len, |
|
636 |
uint32_t *nr1, uint32_t *nr2); |
|
637 |
bool my_coll_init_8bit_bin(CHARSET_INFO *cs, |
|
638 |
cs_alloc_func); |
|
639 |
int my_strnncoll_binary(const CHARSET_INFO * const, |
|
640 |
const unsigned char *s, size_t slen, |
|
641 |
const unsigned char *t, size_t tlen, |
|
642 |
bool t_is_prefix); |
|
643 |
int my_strnncollsp_binary(const CHARSET_INFO * const cs, |
|
644 |
const unsigned char *s, size_t slen, |
|
645 |
const unsigned char *t, size_t tlen, |
|
646 |
bool); |
|
647 |
||
648 |
||
1
by brian
clean slate |
649 |
#define _MY_U 01 /* Upper case */ |
650 |
#define _MY_L 02 /* Lower case */ |
|
651 |
#define _MY_NMR 04 /* Numeral (digit) */ |
|
652 |
#define _MY_SPC 010 /* Spacing character */ |
|
653 |
#define _MY_PNT 020 /* Punctuation */ |
|
654 |
#define _MY_CTR 040 /* Control character */ |
|
655 |
#define _MY_B 0100 /* Blank */ |
|
656 |
#define _MY_X 0200 /* heXadecimal digit */ |
|
657 |
||
658 |
||
659 |
#define my_isascii(c) (!((c) & ~0177))
|
|
660 |
#define my_toascii(c) ((c) & 0177)
|
|
661 |
#define my_tocntrl(c) ((c) & 31)
|
|
662 |
#define my_toprint(c) ((c) | 64)
|
|
481
by Brian Aker
Remove all of uchar. |
663 |
#define my_toupper(s,c) (char) ((s)->to_upper[(unsigned char) (c)])
|
664 |
#define my_tolower(s,c) (char) ((s)->to_lower[(unsigned char) (c)])
|
|
665 |
#define my_isalpha(s, c) (((s)->ctype+1)[(unsigned char) (c)] & (_MY_U | _MY_L))
|
|
666 |
#define my_isupper(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_U)
|
|
667 |
#define my_islower(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_L)
|
|
668 |
#define my_isdigit(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_NMR)
|
|
669 |
#define my_isxdigit(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_X)
|
|
670 |
#define my_isalnum(s, c) (((s)->ctype+1)[(unsigned char) (c)] & (_MY_U | _MY_L | _MY_NMR))
|
|
671 |
#define my_isspace(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_SPC)
|
|
672 |
#define my_ispunct(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_PNT)
|
|
673 |
#define my_isprint(s, c) (((s)->ctype+1)[(unsigned char) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
|
|
674 |
#define my_isgraph(s, c) (((s)->ctype+1)[(unsigned char) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
|
|
675 |
#define my_iscntrl(s, c) (((s)->ctype+1)[(unsigned char) (c)] & _MY_CTR)
|
|
1
by brian
clean slate |
676 |
|
677 |
/* Some macros that should be cleaned up a little */
|
|
678 |
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
|
|
679 |
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
|
680 |
||
681 |
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
|
682 |
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
|
683 |
#define my_strnxfrm(cs, d, dl, s, sl) \
|
|
684 |
((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_WITH_SPACE))
|
|
685 |
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
|
|
686 |
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
|
687 |
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
|
688 |
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
|
689 |
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
|
|
690 |
#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
|
|
691 |
||
692 |
||
693 |
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
|
694 |
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
|
695 |
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
|
696 |
||
697 |
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
|
|
698 |
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
|
|
699 |
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
|
|
700 |
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
|
|
701 |
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
|
|
702 |
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
|
|
703 |
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
|
|
704 |
||
1054.2.11
by Monty Taylor
Removed copy_and_convert. |
705 |
int make_escape_code(const CHARSET_INFO * const cs, const char *escape); |
1
by brian
clean slate |
706 |
|
707 |
#ifdef __cplusplus
|
|
708 |
}
|
|
709 |
#endif
|
|
710 |
||
1241.9.61
by Monty Taylor
No more mystrings in drizzled/ |
711 |
#endif /* DRIZZLED_CHARSET_INFO_H */ |