1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
4 |
* Copyright (C) 2008 Sun Microsystems, Inc.
|
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
20 |
/*
|
21 |
Header File that defines all the charset declarations being used in Drizzle source code
|
|
22 |
*/
|
|
23 |
||
2234
by Brian Aker
Mass removal of ifdef/endif in favor of pragma once. |
24 |
#pragma once
|
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
25 |
|
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
26 |
#include <sys/types.h> |
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
27 |
#include <cstddef> |
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
28 |
#include <drizzled/visibility.h> |
2173.2.1
by Monty Taylor
Fixes incorrect usage of include |
29 |
#include <drizzled/definitions.h> |
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
30 |
|
2318.6.108
by Olaf van der Spek
Oops |
31 |
namespace drizzled { |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
32 |
|
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
33 |
#define MY_CS_NAME_SIZE 32
|
34 |
#define MY_CS_CTYPE_TABLE_SIZE 257
|
|
35 |
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
|
36 |
#define MY_CS_TO_UPPER_TABLE_SIZE 256
|
|
37 |
#define MY_CS_SORT_ORDER_TABLE_SIZE 256
|
|
38 |
#define MY_CS_TO_UNI_TABLE_SIZE 256
|
|
39 |
#define CHARSET_DIR "charsets/"
|
|
40 |
#define my_wc_t unsigned long
|
|
41 |
/* wm_wc and wc_mb return codes */
|
|
42 |
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */ |
|
43 |
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */ |
|
44 |
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */ |
|
45 |
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */ |
|
46 |
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */ |
|
47 |
/* These following three are currently not really used */
|
|
48 |
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */ |
|
49 |
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */ |
|
50 |
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */ |
|
51 |
#define MY_SEQ_INTTAIL 1
|
|
52 |
#define MY_SEQ_SPACES 2
|
|
53 |
#define MY_CS_COMPILED 1 /* compiled-in sets */ |
|
54 |
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */ |
|
55 |
#define MY_CS_INDEX 4 /* sets listed in the Index file */ |
|
56 |
#define MY_CS_LOADED 8 /* sets that are currently loaded */ |
|
57 |
#define MY_CS_BINSORT 16 /* if binary sort order */ |
|
58 |
#define MY_CS_PRIMARY 32 /* if primary collation */ |
|
59 |
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ |
|
60 |
#define MY_CS_UNICODE 128 /* is a charset is full unicode */ |
|
61 |
#define MY_CS_READY 256 /* if a charset is initialized */ |
|
62 |
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ |
|
63 |
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ |
|
64 |
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */ |
|
65 |
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */ |
|
66 |
#define MY_CHARSET_UNDEFINED 0
|
|
67 |
/* Flags for strxfrm */
|
|
68 |
#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */ |
|
69 |
#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */ |
|
70 |
#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */ |
|
71 |
#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */ |
|
72 |
#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */ |
|
73 |
#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */ |
|
74 |
#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */ |
|
75 |
#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/ |
|
76 |
#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */ |
|
77 |
#define MY_STRXFRM_UNUSED_00000080 0x00000080 /* for future extensions */ |
|
78 |
#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */ |
|
79 |
#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */ |
|
80 |
#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */ |
|
81 |
#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */ |
|
82 |
#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */ |
|
83 |
#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */ |
|
84 |
#define MY_STRXFRM_DESC_SHIFT 8
|
|
85 |
#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */ |
|
86 |
#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */ |
|
87 |
#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */ |
|
88 |
#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */ |
|
89 |
#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */ |
|
90 |
#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */ |
|
91 |
#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */ |
|
92 |
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ |
|
93 |
#define MY_STRXFRM_REVERSE_SHIFT 16
|
|
94 |
#define ILLEGAL_CHARSET_INFO_NUMBER (UINT32_MAX)
|
|
95 |
#define MY_UTF8MB4 "utf8"
|
|
96 |
#define my_charset_utf8_general_ci ::drizzled::my_charset_utf8mb4_general_ci
|
|
97 |
#define my_charset_utf8_bin ::drizzled::my_charset_utf8mb4_bin
|
|
98 |
#define _MY_U 01 /* Upper case */ |
|
99 |
#define _MY_L 02 /* Lower case */ |
|
100 |
#define _MY_NMR 04 /* Numeral (digit) */ |
|
101 |
#define _MY_SPC 010 /* Spacing character */ |
|
102 |
#define _MY_PNT 020 /* Punctuation */ |
|
103 |
#define _MY_CTR 040 /* Control character */ |
|
104 |
#define _MY_B 0100 /* Blank */ |
|
105 |
#define _MY_X 0200 /* heXadecimal digit */ |
|
106 |
||
107 |
/* Some typedef to make it easy for C++ to make function pointers */
|
|
108 |
typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st * const, my_wc_t *, |
|
109 |
const unsigned char *, const unsigned char *); |
|
110 |
typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st * const, my_wc_t, |
|
111 |
unsigned char *, unsigned char *); |
|
112 |
typedef size_t (*my_charset_conv_case)(const struct charset_info_st * const, |
|
113 |
char *, size_t, char *, size_t); |
|
114 |
struct charset_info_st; |
|
115 |
typedef struct unicase_info_st |
|
116 |
{
|
|
117 |
uint16_t toupper; |
|
118 |
uint16_t tolower; |
|
119 |
uint16_t sort; |
|
120 |
} MY_UNICASE_INFO; |
|
121 |
||
122 |
typedef struct uni_ctype_st |
|
123 |
{
|
|
124 |
unsigned char pctype; |
|
125 |
unsigned char *ctype; |
|
126 |
} MY_UNI_CTYPE; |
|
127 |
||
128 |
/* A helper function for "need at least n bytes" */
|
|
129 |
inline static int my_cs_toosmalln(int n) |
|
130 |
{
|
|
131 |
return -100-n; |
|
132 |
}
|
|
133 |
||
134 |
typedef struct my_uni_idx_st |
|
135 |
{
|
|
136 |
uint16_t from; |
|
137 |
uint16_t to; |
|
138 |
unsigned char *tab; |
|
139 |
} MY_UNI_IDX; |
|
140 |
||
141 |
typedef struct |
|
142 |
{
|
|
143 |
uint32_t beg; |
|
144 |
uint32_t end; |
|
145 |
uint32_t mb_len; |
|
146 |
} my_match_t; |
|
147 |
||
148 |
enum my_lex_states |
|
149 |
{
|
|
150 |
MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, |
|
151 |
MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, |
|
152 |
MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER, |
|
2318.8.15
by Olaf van der Spek
Fix MY_LEX_STRING |
153 |
MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, |
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
154 |
MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, |
155 |
MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, |
|
156 |
MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, |
|
157 |
MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, |
|
158 |
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, |
|
159 |
MY_LEX_IDENT_OR_KEYWORD, |
|
160 |
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, |
|
161 |
MY_LEX_STRING_OR_DELIMITER
|
|
162 |
};
|
|
163 |
||
164 |
struct charset_info_st; |
|
165 |
||
166 |
/* See strings/charset_info_st.txt for information about this structure */
|
|
167 |
typedef struct my_collation_handler_st |
|
168 |
{
|
|
2318.6.109
by Olaf van der Spek
Refactor |
169 |
bool (*init)(charset_info_st&, unsigned char *(*alloc)(size_t)); |
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
170 |
/* Collation routines */
|
171 |
int (*strnncoll)(const struct charset_info_st * const, |
|
172 |
const unsigned char *, size_t, const unsigned char *, size_t, bool); |
|
173 |
int (*strnncollsp)(const struct charset_info_st * const, |
|
174 |
const unsigned char *, size_t, const unsigned char *, size_t, |
|
175 |
bool diff_if_only_endspace_difference); |
|
176 |
size_t (*strnxfrm)(const struct charset_info_st * const, |
|
177 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
|
178 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
179 |
size_t (*strnxfrmlen)(const struct charset_info_st * const, size_t); |
|
180 |
bool (*like_range)(const struct charset_info_st * const, |
|
181 |
const char *s, size_t s_length, |
|
182 |
char escape, char w_one, char w_many, |
|
183 |
size_t res_length, |
|
184 |
char *min_str, char *max_str, |
|
185 |
size_t *min_len, size_t *max_len); |
|
186 |
int (*wildcmp)(const struct charset_info_st * const, |
|
187 |
const char *str,const char *str_end, |
|
188 |
const char *wildstr,const char *wildend, |
|
189 |
int escape,int w_one, int w_many); |
|
190 |
||
191 |
int (*strcasecmp)(const struct charset_info_st * const, const char *, const char *); |
|
192 |
||
193 |
uint32_t (*instr)(const struct charset_info_st * const, |
|
194 |
const char *b, size_t b_length, |
|
195 |
const char *s, size_t s_length, |
|
196 |
my_match_t *match, uint32_t nmatch); |
|
197 |
||
198 |
/* Hash calculation */
|
|
199 |
void (*hash_sort)(const struct charset_info_st *cs, const unsigned char *key, size_t len, |
|
200 |
uint32_t *nr1, uint32_t *nr2); |
|
201 |
bool (*propagate)(const struct charset_info_st *cs, const unsigned char *str, size_t len); |
|
202 |
} MY_COLLATION_HANDLER; |
|
203 |
||
204 |
/* See strings/charset_info_st.txt about information on this structure */
|
|
205 |
typedef struct my_charset_handler_st |
|
206 |
{
|
|
2318.6.108
by Olaf van der Spek
Oops |
207 |
void (*init_unused)(); |
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
208 |
/* Multibyte routines */
|
209 |
uint32_t (*ismbchar)(const struct charset_info_st * const, const char *, const char *); |
|
210 |
uint32_t (*mbcharlen)(const struct charset_info_st * const, uint32_t c); |
|
211 |
size_t (*numchars)(const struct charset_info_st * const, const char *b, const char *e); |
|
212 |
size_t (*charpos)(const struct charset_info_st * const, const char *b, const char *e, |
|
213 |
size_t pos); |
|
214 |
size_t (*well_formed_len)(const struct charset_info_st * const, |
|
215 |
const char *b,const char *e, |
|
216 |
size_t nchars, int *error); |
|
217 |
size_t (*lengthsp)(const struct charset_info_st * const, const char *ptr, size_t length); |
|
218 |
size_t (*numcells)(const struct charset_info_st * const, const char *b, const char *e); |
|
219 |
||
220 |
/* Unicode conversion */
|
|
221 |
my_charset_conv_mb_wc mb_wc; |
|
222 |
my_charset_conv_wc_mb wc_mb; |
|
223 |
||
224 |
/* CTYPE scanner */
|
|
225 |
int (*ctype)(const struct charset_info_st *cs, int *ctype, |
|
226 |
const unsigned char *s, const unsigned char *e); |
|
227 |
||
228 |
/* Functions for case and sort conversion */
|
|
229 |
size_t (*caseup_str)(const struct charset_info_st * const, char *); |
|
230 |
size_t (*casedn_str)(const struct charset_info_st * const, char *); |
|
231 |
||
232 |
my_charset_conv_case caseup; |
|
233 |
my_charset_conv_case casedn; |
|
234 |
||
235 |
/* Charset dependant snprintf() */
|
|
236 |
size_t (*snprintf)(const struct charset_info_st * const, char *to, size_t n, |
|
237 |
const char *fmt, |
|
238 |
...)
|
|
239 |
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
|
240 |
__attribute__((format(printf, 4, 5))) |
|
241 |
#endif
|
|
242 |
;
|
|
243 |
size_t (*long10_to_str)(const struct charset_info_st * const, char *to, size_t n, |
|
244 |
int radix, long int val); |
|
245 |
size_t (*int64_t10_to_str)(const struct charset_info_st * const, char *to, size_t n, |
|
246 |
int radix, int64_t val); |
|
247 |
||
248 |
void (*fill)(const struct charset_info_st * const, char *to, size_t len, int fill); |
|
249 |
||
250 |
/* String-to-number conversion routines */
|
|
251 |
long (*strntol)(const struct charset_info_st * const, const char *s, size_t l, |
|
252 |
int base, char **e, int *err); |
|
253 |
unsigned long (*strntoul)(const struct charset_info_st * const, const char *s, size_t l, |
|
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, |
|
260 |
int *err); |
|
261 |
int64_t (*strtoll10)(const struct charset_info_st *cs, |
|
262 |
const char *nptr, char **endptr, int *error); |
|
263 |
uint64_t (*strntoull10rnd)(const struct charset_info_st *cs, |
|
264 |
const char *str, size_t length, |
|
265 |
int unsigned_fl, |
|
266 |
char **endptr, int *error); |
|
267 |
size_t (*scan)(const struct charset_info_st * const, const char *b, const char *e, |
|
268 |
int sq); |
|
269 |
} MY_CHARSET_HANDLER; |
|
270 |
||
271 |
||
272 |
/* See strings/charset_info_st.txt about information on this structure */
|
|
273 |
struct charset_info_st |
|
274 |
{
|
|
275 |
uint32_t number; |
|
276 |
uint32_t primary_number; |
|
277 |
uint32_t binary_number; |
|
278 |
uint32_t state; |
|
279 |
const char *csname; |
|
280 |
const char *name; |
|
281 |
const char *comment; |
|
282 |
const char *tailoring; |
|
283 |
unsigned char *ctype; |
|
284 |
unsigned char *to_lower; |
|
285 |
unsigned char *to_upper; |
|
286 |
unsigned char *sort_order; |
|
287 |
uint16_t *contractions; |
|
288 |
uint16_t **sort_order_big; |
|
289 |
uint16_t *tab_to_uni; |
|
290 |
MY_UNI_IDX *tab_from_uni; |
|
291 |
MY_UNICASE_INFO **caseinfo; |
|
292 |
unsigned char *state_map; |
|
293 |
unsigned char *ident_map; |
|
294 |
uint32_t strxfrm_multiply; |
|
295 |
unsigned char caseup_multiply; |
|
296 |
unsigned char casedn_multiply; |
|
297 |
uint32_t mbminlen; |
|
298 |
uint32_t mbmaxlen; |
|
299 |
uint16_t min_sort_char; |
|
300 |
uint16_t max_sort_char; /* For LIKE optimization */ |
|
301 |
unsigned char pad_char; |
|
302 |
bool escape_with_backslash_is_dangerous; |
|
303 |
unsigned char levels_for_compare; |
|
304 |
unsigned char levels_for_order; |
|
305 |
||
306 |
MY_CHARSET_HANDLER *cset; |
|
307 |
MY_COLLATION_HANDLER *coll; |
|
308 |
||
309 |
};
|
|
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
310 |
|
2254
by Brian Aker
Shift CHARSET_INFO to charset_info_st |
311 |
extern DRIZZLED_API charset_info_st *all_charsets[256]; |
312 |
extern charset_info_st compiled_charsets[]; |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
313 |
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags); |
314 |
extern uint32_t get_collation_number(const char *name); |
|
315 |
extern const char *get_charset_name(uint32_t cs_number); |
|
316 |
extern bool resolve_charset(const char *cs_name, |
|
2254
by Brian Aker
Shift CHARSET_INFO to charset_info_st |
317 |
const charset_info_st *default_cs, |
318 |
const charset_info_st **cs); |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
319 |
extern bool resolve_collation(const char *cl_name, |
2254
by Brian Aker
Shift CHARSET_INFO to charset_info_st |
320 |
const charset_info_st *default_cl, |
321 |
const charset_info_st **cl); |
|
2318.6.107
by Olaf van der Spek
MY_CHARSET_HANDLER::init is unused |
322 |
extern void free_charsets(); |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
323 |
extern char *get_charsets_dir(char *buf); |
2254
by Brian Aker
Shift CHARSET_INFO to charset_info_st |
324 |
extern bool my_charset_same(const charset_info_st *cs1, const charset_info_st *cs2); |
325 |
extern size_t escape_string_for_drizzle(const charset_info_st *charset_info, |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
326 |
char *to, size_t to_length, |
327 |
const char *from, size_t length); |
|
2254
by Brian Aker
Shift CHARSET_INFO to charset_info_st |
328 |
extern size_t escape_quotes_for_drizzle(const charset_info_st *charset_info, |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
329 |
char *to, size_t to_length, |
330 |
const char *from, size_t length); |
|
2281.5.1
by Muhammad Umair
Merged charset declarations of global_charset_info.h and charset_info.h into charset.h header file. |
331 |
extern DRIZZLED_API const charset_info_st *default_charset_info; |
332 |
extern DRIZZLED_API const charset_info_st *system_charset_info; |
|
333 |
extern const charset_info_st *files_charset_info; |
|
334 |
extern const charset_info_st *table_alias_charset; |
|
335 |
extern MY_UNICASE_INFO *my_unicase_default[256]; |
|
336 |
extern MY_UNICASE_INFO *my_unicase_turkish[256]; |
|
337 |
extern MY_UNI_CTYPE my_uni_ctype[256]; |
|
338 |
extern DRIZZLED_API charset_info_st my_charset_bin; |
|
339 |
extern DRIZZLED_API charset_info_st my_charset_utf8mb4_bin; |
|
340 |
extern DRIZZLED_API charset_info_st my_charset_utf8mb4_general_ci; |
|
341 |
extern DRIZZLED_API charset_info_st my_charset_utf8mb4_unicode_ci; |
|
342 |
size_t my_strnxfrmlen_simple(const charset_info_st * const, size_t); |
|
343 |
extern int my_strnncollsp_simple(const charset_info_st * const, const unsigned char *, size_t, |
|
344 |
const unsigned char *, size_t, |
|
345 |
bool diff_if_only_endspace_difference); |
|
346 |
extern size_t my_lengthsp_8bit(const charset_info_st * const cs, const char *ptr, size_t length); |
|
347 |
extern uint32_t my_instr_simple(const charset_info_st * const, |
|
348 |
const char *b, size_t b_length, |
|
349 |
const char *s, size_t s_length, |
|
350 |
my_match_t *match, uint32_t nmatch); |
|
351 |
extern MY_CHARSET_HANDLER my_charset_8bit_handler; |
|
352 |
extern MY_CHARSET_HANDLER my_charset_ucs2_handler; |
|
353 |
extern int my_strcasecmp_mb(const charset_info_st * const cs, const char *s, const char *t); |
|
354 |
extern bool my_parse_charset_xml(const char *bug, size_t len, |
|
355 |
int (*add)(charset_info_st *cs)); |
|
356 |
||
357 |
DRIZZLED_API const charset_info_st *get_charset(uint32_t cs_number); |
|
358 |
DRIZZLED_API const charset_info_st *get_charset_by_name(const char *cs_name); |
|
359 |
DRIZZLED_API const charset_info_st *get_charset_by_csname(const char *cs_name, uint32_t cs_flags); |
|
360 |
||
361 |
/* Functions for 8bit */
|
|
362 |
int my_mb_ctype_8bit(const charset_info_st * const,int *, const unsigned char *,const unsigned char *); |
|
363 |
int my_mb_ctype_mb(const charset_info_st * const,int *, const unsigned char *,const unsigned char *); |
|
364 |
||
365 |
size_t my_scan_8bit(const charset_info_st * const cs, const char *b, const char *e, int sq); |
|
366 |
||
367 |
size_t my_snprintf_8bit(const charset_info_st * const, char *to, size_t n, |
|
368 |
const char *fmt, ...) |
|
369 |
__attribute__((format(printf, 4, 5))); |
|
370 |
||
371 |
long my_strntol_8bit(const charset_info_st * const, const char *s, size_t l, int base, |
|
372 |
char **e, int *err); |
|
373 |
unsigned long my_strntoul_8bit(const charset_info_st * const, const char *s, size_t l, int base, |
|
374 |
char **e, int *err); |
|
375 |
int64_t my_strntoll_8bit(const charset_info_st * const, const char *s, size_t l, int base, |
|
376 |
char **e, int *err); |
|
377 |
uint64_t my_strntoull_8bit(const charset_info_st * const, const char *s, size_t l, int base, |
|
378 |
char **e, int *err); |
|
379 |
double my_strntod_8bit(const charset_info_st * const, char *s, size_t l,char **e, |
|
380 |
int *err); |
|
381 |
size_t my_long10_to_str_8bit(const charset_info_st * const, char *to, size_t l, int radix, |
|
382 |
long int val); |
|
383 |
size_t my_int64_t10_to_str_8bit(const charset_info_st * const, char *to, size_t l, int radix, |
|
384 |
int64_t val); |
|
385 |
int64_t my_strtoll10_8bit(const charset_info_st * const cs, |
|
386 |
const char *nptr, char **endptr, int *error); |
|
387 |
int64_t my_strtoll10_ucs2(charset_info_st *cs, |
|
388 |
const char *nptr, char **endptr, int *error); |
|
389 |
||
390 |
uint64_t my_strntoull10rnd_8bit(const charset_info_st * const cs, |
|
391 |
const char *str, size_t length, int |
|
392 |
unsigned_fl, char **endptr, int *error); |
|
393 |
uint64_t my_strntoull10rnd_ucs2(charset_info_st *cs, |
|
394 |
const char *str, size_t length, |
|
395 |
int unsigned_fl, char **endptr, int *error); |
|
396 |
||
397 |
void my_fill_8bit(const charset_info_st * const cs, char* to, size_t l, int fill); |
|
398 |
||
399 |
bool my_like_range_simple(const charset_info_st * const cs, |
|
400 |
const char *ptr, size_t ptr_length, |
|
401 |
char escape, char w_one, char w_many, |
|
402 |
size_t res_length, |
|
403 |
char *min_str, char *max_str, |
|
404 |
size_t *min_length, size_t *max_length); |
|
405 |
||
406 |
bool my_like_range_mb(const charset_info_st * const cs, |
|
407 |
const char *ptr, size_t ptr_length, |
|
408 |
char escape, char w_one, char w_many, |
|
409 |
size_t res_length, |
|
410 |
char *min_str, char *max_str, |
|
411 |
size_t *min_length, size_t *max_length); |
|
412 |
||
413 |
bool my_like_range_ucs2(const charset_info_st * const cs, |
|
414 |
const char *ptr, size_t ptr_length, |
|
415 |
char escape, char w_one, char w_many, |
|
416 |
size_t res_length, |
|
417 |
char *min_str, char *max_str, |
|
418 |
size_t *min_length, size_t *max_length); |
|
419 |
||
420 |
bool my_like_range_utf16(const charset_info_st * const cs, |
|
421 |
const char *ptr, size_t ptr_length, |
|
422 |
char escape, char w_one, char w_many, |
|
423 |
size_t res_length, |
|
424 |
char *min_str, char *max_str, |
|
425 |
size_t *min_length, size_t *max_length); |
|
426 |
||
427 |
bool my_like_range_utf32(const charset_info_st * const cs, |
|
428 |
const char *ptr, size_t ptr_length, |
|
429 |
char escape, char w_one, char w_many, |
|
430 |
size_t res_length, |
|
431 |
char *min_str, char *max_str, |
|
432 |
size_t *min_length, size_t *max_length); |
|
433 |
||
434 |
||
435 |
int my_wildcmp_8bit(const charset_info_st * const, |
|
436 |
const char *str,const char *str_end, |
|
437 |
const char *wildstr,const char *wildend, |
|
438 |
int escape, int w_one, int w_many); |
|
439 |
||
440 |
int my_wildcmp_bin(const charset_info_st * const, |
|
441 |
const char *str,const char *str_end, |
|
442 |
const char *wildstr,const char *wildend, |
|
443 |
int escape, int w_one, int w_many); |
|
444 |
||
445 |
size_t my_numchars_8bit(const charset_info_st * const, const char *b, const char *e); |
|
446 |
size_t my_numcells_8bit(const charset_info_st * const, const char *b, const char *e); |
|
447 |
size_t my_charpos_8bit(const charset_info_st * const, const char *b, const char *e, size_t pos); |
|
448 |
size_t my_well_formed_len_8bit(const charset_info_st * const, const char *b, const char *e, |
|
449 |
size_t pos, int *error); |
|
450 |
typedef unsigned char *(*cs_alloc_func)(size_t); |
|
451 |
bool my_coll_init_simple(charset_info_st *cs, cs_alloc_func alloc); |
|
452 |
bool my_cset_init_8bit(charset_info_st *cs, cs_alloc_func alloc); |
|
453 |
uint32_t my_mbcharlen_8bit(const charset_info_st * const, uint32_t c); |
|
454 |
||
455 |
/* Functions for multibyte charsets */
|
|
456 |
int my_wildcmp_mb(const charset_info_st * const, |
|
457 |
const char *str,const char *str_end, |
|
458 |
const char *wildstr,const char *wildend, |
|
459 |
int escape, int w_one, int w_many); |
|
460 |
size_t my_numchars_mb(const charset_info_st * const, const char *b, const char *e); |
|
461 |
size_t my_numcells_mb(const charset_info_st * const, const char *b, const char *e); |
|
462 |
size_t my_charpos_mb(const charset_info_st * const, const char *b, const char *e, size_t pos); |
|
463 |
size_t my_well_formed_len_mb(const charset_info_st * const, const char *b, const char *e, |
|
464 |
size_t pos, int *error); |
|
465 |
uint32_t my_instr_mb(const charset_info_st * const, |
|
466 |
const char *b, size_t b_length, |
|
467 |
const char *s, size_t s_length, |
|
468 |
my_match_t *match, uint32_t nmatch); |
|
469 |
||
470 |
int my_strnncoll_mb_bin(const charset_info_st * const cs, |
|
471 |
const unsigned char *s, size_t slen, |
|
472 |
const unsigned char *t, size_t tlen, |
|
473 |
bool t_is_prefix); |
|
474 |
||
475 |
int my_strnncollsp_mb_bin(const charset_info_st * const cs, |
|
476 |
const unsigned char *a, size_t a_length, |
|
477 |
const unsigned char *b, size_t b_length, |
|
478 |
bool diff_if_only_endspace_difference); |
|
479 |
||
480 |
int my_wildcmp_mb_bin(const charset_info_st * const cs, |
|
481 |
const char *str,const char *str_end, |
|
482 |
const char *wildstr,const char *wildend, |
|
483 |
int escape, int w_one, int w_many); |
|
484 |
||
485 |
int my_strcasecmp_mb_bin(const charset_info_st * const, const char *s, const char *t); |
|
486 |
||
487 |
void my_hash_sort_mb_bin(const charset_info_st * const, |
|
488 |
const unsigned char *key, size_t len, uint32_t *nr1, uint32_t *nr2); |
|
489 |
||
490 |
size_t my_strnxfrm_mb(const charset_info_st * const, |
|
491 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
|
492 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
493 |
||
494 |
int my_wildcmp_unicode(const charset_info_st * const cs, |
|
495 |
const char *str, const char *str_end, |
|
496 |
const char *wildstr, const char *wildend, |
|
497 |
int escape, int w_one, int w_many, |
|
498 |
MY_UNICASE_INFO **weights); |
|
499 |
||
500 |
bool my_propagate_simple(const charset_info_st * const cs, const unsigned char *str, size_t len); |
|
501 |
bool my_propagate_complex(const charset_info_st * const cs, const unsigned char *str, size_t len); |
|
502 |
||
503 |
||
504 |
uint32_t my_strxfrm_flag_normalize(uint32_t flags, uint32_t nlevels); |
|
505 |
void my_strxfrm_desc_and_reverse(unsigned char *str, unsigned char *strend, |
|
506 |
uint32_t flags, uint32_t level); |
|
507 |
size_t my_strxfrm_pad_desc_and_reverse(const charset_info_st * const cs, |
|
508 |
unsigned char *str, unsigned char *frmend, unsigned char *strend, |
|
509 |
uint32_t nweights, uint32_t flags, uint32_t level); |
|
510 |
||
511 |
bool my_charset_is_ascii_compatible(const charset_info_st * const cs); |
|
512 |
||
513 |
/*
|
|
514 |
Compare 0-terminated UTF8 strings.
|
|
515 |
||
516 |
SYNOPSIS
|
|
517 |
my_strcasecmp_utf8mb3()
|
|
518 |
cs character set handler
|
|
519 |
s First 0-terminated string to compare
|
|
520 |
t Second 0-terminated string to compare
|
|
521 |
||
522 |
IMPLEMENTATION
|
|
523 |
||
524 |
RETURN
|
|
525 |
- negative number if s < t
|
|
526 |
- positive number if s > t
|
|
527 |
- 0 is the strings are equal
|
|
528 |
*/
|
|
529 |
int my_wc_mb_filename(const charset_info_st * const, |
|
530 |
my_wc_t wc, unsigned char *s, unsigned char *e); |
|
531 |
||
532 |
int my_mb_wc_filename(const charset_info_st * const, |
|
533 |
my_wc_t *pwc, const unsigned char *s, const unsigned char *e); |
|
534 |
||
535 |
||
536 |
unsigned int my_ismbchar_utf8mb4(const charset_info_st * const cs, const char *b, const char *e); |
|
537 |
unsigned int my_mbcharlen_utf8mb4(const charset_info_st * const, uint32_t c); |
|
538 |
||
539 |
size_t my_strnxfrmlen_utf8mb4(const charset_info_st * const, size_t len); |
|
540 |
size_t
|
|
541 |
my_strnxfrm_utf8mb4(const charset_info_st * const cs, |
|
542 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
|
543 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
544 |
||
545 |
int my_wildcmp_utf8mb4(const charset_info_st * const cs, |
|
546 |
const char *str, const char *strend, |
|
547 |
const char *wildstr, const char *wildend, |
|
548 |
int escape, int w_one, int w_many); |
|
549 |
int my_strnncollsp_utf8mb4(const charset_info_st * const cs, |
|
550 |
const unsigned char *s, size_t slen, |
|
551 |
const unsigned char *t, size_t tlen, |
|
552 |
bool diff_if_only_endspace_difference); |
|
553 |
int my_strcasecmp_utf8mb4(const charset_info_st * const cs, |
|
554 |
const char *s, const char *t); |
|
555 |
||
556 |
int my_strnncoll_utf8mb4(const charset_info_st * const cs, |
|
557 |
const unsigned char *s, size_t slen, |
|
558 |
const unsigned char *t, size_t tlen, |
|
559 |
bool t_is_prefix); |
|
560 |
||
561 |
int my_mb_wc_utf8mb4(const charset_info_st * const cs, |
|
562 |
my_wc_t * pwc, const unsigned char *s, const unsigned char *e); |
|
563 |
||
564 |
int my_wc_mb_utf8mb4(const charset_info_st * const cs, |
|
565 |
my_wc_t wc, unsigned char *r, unsigned char *e); |
|
566 |
||
567 |
size_t my_caseup_str_utf8mb4(const charset_info_st * const cs, char *src); |
|
568 |
size_t my_casedn_str_utf8mb4(const charset_info_st * const cs, char *src); |
|
569 |
||
570 |
size_t my_caseup_utf8mb4(const charset_info_st * const cs, char *src, size_t srclen, |
|
571 |
char *dst, size_t dstlen); |
|
572 |
size_t my_casedn_utf8mb4(const charset_info_st * const cs, |
|
573 |
char *src, size_t srclen, |
|
574 |
char *dst, size_t dstlen); |
|
575 |
||
576 |
||
577 |
int my_strnncoll_any_uca(const charset_info_st * const cs, |
|
578 |
const unsigned char *s, size_t slen, |
|
579 |
const unsigned char *t, size_t tlen, |
|
580 |
bool t_is_prefix); |
|
581 |
||
582 |
int my_strnncollsp_any_uca(const charset_info_st * const cs, |
|
583 |
const unsigned char *s, size_t slen, |
|
584 |
const unsigned char *t, size_t tlen, |
|
585 |
bool diff_if_only_endspace_difference); |
|
586 |
||
587 |
void my_hash_sort_any_uca(const charset_info_st * const cs, |
|
588 |
const unsigned char *s, size_t slen, |
|
589 |
uint32_t *n1, uint32_t *n2); |
|
590 |
||
591 |
size_t my_strnxfrm_any_uca(const charset_info_st * const cs, |
|
592 |
unsigned char *dst, size_t dstlen, uint32_t nweights, |
|
593 |
const unsigned char *src, size_t srclen, |
|
594 |
uint32_t flags); |
|
595 |
||
596 |
int my_wildcmp_uca(const charset_info_st * const cs, |
|
597 |
const char *str,const char *str_end, |
|
598 |
const char *wildstr,const char *wildend, |
|
599 |
int escape, int w_one, int w_many); |
|
600 |
||
601 |
int my_strnncoll_8bit_bin(const charset_info_st * const, |
|
602 |
const unsigned char *s, size_t slen, |
|
603 |
const unsigned char *t, size_t tlen, |
|
604 |
bool t_is_prefix); |
|
605 |
int my_strnncollsp_8bit_bin(const charset_info_st * const, |
|
606 |
const unsigned char *a, size_t a_length, |
|
607 |
const unsigned char *b, size_t b_length, |
|
608 |
bool diff_if_only_endspace_difference); |
|
609 |
size_t my_case_str_bin(const charset_info_st * const, char *); |
|
610 |
size_t my_case_bin(const charset_info_st * const, char *, |
|
611 |
size_t srclen, char *, size_t); |
|
612 |
int my_strcasecmp_bin(const charset_info_st * const, |
|
613 |
const char *s, const char *t); |
|
614 |
size_t my_strnxfrm_8bit_bin(const charset_info_st * const cs, |
|
615 |
unsigned char * dst, size_t dstlen, uint32_t nweights, |
|
616 |
const unsigned char *src, size_t srclen, uint32_t flags); |
|
617 |
uint32_t my_instr_bin(const charset_info_st * const, |
|
618 |
const char *b, size_t b_length, |
|
619 |
const char *s, size_t s_length, |
|
620 |
my_match_t *match, uint32_t nmatch); |
|
621 |
size_t my_lengthsp_binary(const charset_info_st * const, |
|
622 |
const char *, size_t length); |
|
623 |
int my_mb_wc_bin(const charset_info_st * const, |
|
624 |
my_wc_t *wc, const unsigned char *str, |
|
625 |
const unsigned char *end); |
|
626 |
int my_wc_mb_bin(const charset_info_st * const, my_wc_t wc, |
|
627 |
unsigned char *str, unsigned char *end); |
|
628 |
void my_hash_sort_8bit_bin(const charset_info_st * const, |
|
629 |
const unsigned char *key, size_t len, |
|
630 |
uint32_t *nr1, uint32_t *nr2); |
|
631 |
bool my_coll_init_8bit_bin(charset_info_st *cs, |
|
632 |
cs_alloc_func); |
|
633 |
int my_strnncoll_binary(const charset_info_st * const, |
|
634 |
const unsigned char *s, size_t slen, |
|
635 |
const unsigned char *t, size_t tlen, |
|
636 |
bool t_is_prefix); |
|
637 |
int my_strnncollsp_binary(const charset_info_st * const cs, |
|
638 |
const unsigned char *s, size_t slen, |
|
639 |
const unsigned char *t, size_t tlen, |
|
640 |
bool); |
|
641 |
||
642 |
inline static bool my_isascii(char c) |
|
643 |
{
|
|
644 |
return (!(c & ~0177)); |
|
645 |
}
|
|
646 |
||
647 |
inline static char my_toascii(char c) |
|
648 |
{
|
|
649 |
return (c & 0177); |
|
650 |
}
|
|
651 |
||
652 |
inline static char my_tocntrl(char c) |
|
653 |
{
|
|
654 |
return (c & 31); |
|
655 |
}
|
|
656 |
||
657 |
inline static char my_toprint(char c) |
|
658 |
{
|
|
659 |
return (c | 64); |
|
660 |
}
|
|
661 |
||
662 |
inline static char my_toupper(const charset_info_st *s, unsigned char c) |
|
663 |
{
|
|
664 |
return s->to_upper[c]; |
|
665 |
}
|
|
666 |
||
667 |
inline static char my_tolower(const charset_info_st *s, unsigned char c) |
|
668 |
{
|
|
669 |
return s->to_lower[c]; |
|
670 |
}
|
|
671 |
||
672 |
inline static bool my_isalpha(const charset_info_st *s, unsigned char c) |
|
673 |
{
|
|
674 |
return (s->ctype+1)[c] & (_MY_U | _MY_L); |
|
675 |
}
|
|
676 |
||
677 |
inline static bool my_isupper(const charset_info_st *s, unsigned char c) |
|
678 |
{
|
|
679 |
return (s->ctype+1)[c] & _MY_U; |
|
680 |
}
|
|
681 |
||
682 |
inline static bool my_islower(const charset_info_st *s, unsigned char c) |
|
683 |
{
|
|
684 |
return (s->ctype+1)[c] & _MY_L; |
|
685 |
}
|
|
686 |
||
687 |
inline static bool my_isdigit(const charset_info_st *s, unsigned char c) |
|
688 |
{
|
|
689 |
return (s->ctype+1)[c] & _MY_NMR; |
|
690 |
}
|
|
691 |
||
692 |
inline static bool my_isxdigit(const charset_info_st *s, unsigned char c) |
|
693 |
{
|
|
694 |
return (s->ctype+1)[c] & _MY_X; |
|
695 |
}
|
|
696 |
||
697 |
inline static bool my_isalnum(const charset_info_st *s, unsigned char c) |
|
698 |
{
|
|
699 |
return (s->ctype+1)[c] & (_MY_U | _MY_L | _MY_NMR); |
|
700 |
}
|
|
701 |
||
702 |
inline static bool my_isspace(const charset_info_st *s, unsigned char c) |
|
703 |
{
|
|
704 |
return (s->ctype+1)[c] & _MY_SPC; |
|
705 |
}
|
|
706 |
||
707 |
inline static bool my_ispunct(const charset_info_st *s, unsigned char c) |
|
708 |
{
|
|
709 |
return (s->ctype+1)[c] & _MY_PNT; |
|
710 |
}
|
|
711 |
||
712 |
inline static bool my_isprint(const charset_info_st *s, unsigned char c) |
|
713 |
{
|
|
714 |
return (s->ctype+1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B); |
|
715 |
}
|
|
716 |
||
717 |
inline static bool my_isgraph(const charset_info_st *s, unsigned char c) |
|
718 |
{
|
|
719 |
return (s->ctype+1)[c] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR); |
|
720 |
}
|
|
721 |
||
722 |
inline static bool my_iscntrl(const charset_info_st *s, unsigned char c) |
|
723 |
{
|
|
724 |
return (s->ctype+1)[c] & _MY_CTR; |
|
725 |
}
|
|
726 |
||
727 |
/* Some macros that should be cleaned up a little */
|
|
728 |
inline static bool my_isvar(const charset_info_st *s, char c) |
|
729 |
{
|
|
730 |
return my_isalnum(s,c) || (c) == '_'; |
|
731 |
}
|
|
732 |
||
733 |
inline static bool my_isvar_start(const charset_info_st *s, char c) |
|
734 |
{
|
|
735 |
return my_isalpha(s,c) || (c) == '_'; |
|
736 |
}
|
|
737 |
||
738 |
inline static bool my_binary_compare(const charset_info_st *s) |
|
739 |
{
|
|
740 |
return s->state & MY_CS_BINSORT; |
|
741 |
}
|
|
742 |
||
743 |
inline static bool use_strnxfrm(const charset_info_st *s) |
|
744 |
{
|
|
745 |
return s->state & MY_CS_STRNXFRM; |
|
746 |
}
|
|
747 |
||
748 |
inline static size_t my_strnxfrm(const charset_info_st *cs, |
|
749 |
unsigned char *dst, |
|
750 |
const size_t dstlen, |
|
751 |
const unsigned char *src, |
|
752 |
const uint32_t srclen) |
|
753 |
{
|
|
754 |
return (cs->coll->strnxfrm(cs, dst, dstlen, dstlen, src, srclen, MY_STRXFRM_PAD_WITH_SPACE)); |
|
755 |
}
|
|
756 |
||
757 |
inline static int my_strnncoll(const charset_info_st *cs, |
|
758 |
const unsigned char *s, |
|
759 |
const size_t slen, |
|
760 |
const unsigned char *t, |
|
761 |
const size_t tlen) |
|
762 |
{
|
|
763 |
return (cs->coll->strnncoll(cs, s, slen, t, tlen, 0)); |
|
764 |
}
|
|
765 |
||
766 |
inline static bool my_like_range(const charset_info_st *cs, |
|
767 |
const char *ptr, const size_t ptrlen, |
|
768 |
const char escape, |
|
769 |
const char w_one, |
|
770 |
const char w_many, |
|
771 |
const size_t reslen, |
|
772 |
char *minstr, char *maxstr, |
|
773 |
size_t *minlen, size_t *maxlen) |
|
774 |
{
|
|
775 |
return (cs->coll->like_range(cs, ptr, ptrlen, escape, w_one, w_many, reslen, |
|
776 |
minstr, maxstr, minlen, maxlen)); |
|
777 |
}
|
|
778 |
||
779 |
inline static int my_wildcmp(const charset_info_st *cs, |
|
780 |
const char *str, const char *strend, |
|
781 |
const char *w_str, const char *w_strend, |
|
782 |
const int escape, |
|
783 |
const int w_one, const int w_many) |
|
784 |
{
|
|
785 |
return (cs->coll->wildcmp(cs, str, strend, w_str, w_strend, escape, w_one, w_many)); |
|
786 |
}
|
|
787 |
||
788 |
inline static int my_strcasecmp(const charset_info_st *cs, const char *s, const char *t) |
|
789 |
{
|
|
790 |
return (cs->coll->strcasecmp(cs, s, t)); |
|
791 |
}
|
|
792 |
||
793 |
template <typename CHAR_T> |
|
794 |
inline static size_t my_charpos(const charset_info_st *cs, |
|
795 |
const CHAR_T *b, const CHAR_T* e, size_t num) |
|
796 |
{
|
|
797 |
return cs->cset->charpos(cs, reinterpret_cast<const char*>(b), reinterpret_cast<const char*>(e), num); |
|
798 |
}
|
|
799 |
||
800 |
inline static bool use_mb(const charset_info_st *cs) |
|
801 |
{
|
|
802 |
return cs->cset->ismbchar != NULL; |
|
803 |
}
|
|
804 |
||
805 |
inline static unsigned int my_ismbchar(const charset_info_st *cs, const char *a, const char *b) |
|
806 |
{
|
|
807 |
return cs->cset->ismbchar(cs, a, b); |
|
808 |
}
|
|
809 |
||
810 |
inline static unsigned int my_mbcharlen(const charset_info_st *cs, uint32_t c) |
|
811 |
{
|
|
812 |
return cs->cset->mbcharlen(cs, c); |
|
813 |
}
|
|
814 |
||
815 |
||
816 |
inline static size_t my_caseup_str(const charset_info_st *cs, char *src) |
|
817 |
{
|
|
818 |
return cs->cset->caseup_str(cs, src); |
|
819 |
}
|
|
820 |
||
821 |
inline static size_t my_casedn_str(const charset_info_st *cs, char *src) |
|
822 |
{
|
|
823 |
return cs->cset->casedn_str(cs, src); |
|
824 |
}
|
|
825 |
||
826 |
inline static long my_strntol(const charset_info_st *cs, |
|
827 |
const char* s, const size_t l, const int base, char **e, int *err) |
|
828 |
{
|
|
829 |
return (cs->cset->strntol(cs, s, l, base, e, err)); |
|
830 |
}
|
|
831 |
||
832 |
inline static unsigned long my_strntoul(const charset_info_st *cs, |
|
833 |
const char* s, const size_t l, const int base, |
|
834 |
char **e, int *err) |
|
835 |
{
|
|
836 |
return (cs->cset->strntoul(cs, s, l, base, e, err)); |
|
837 |
}
|
|
838 |
||
839 |
inline static int64_t my_strntoll(const charset_info_st *cs, |
|
840 |
const char* s, const size_t l, const int base, char **e, int *err) |
|
841 |
{
|
|
842 |
return (cs->cset->strntoll(cs, s, l, base, e, err)); |
|
843 |
}
|
|
844 |
||
845 |
inline static int64_t my_strntoull(const charset_info_st *cs, |
|
846 |
const char* s, const size_t l, const int base, |
|
847 |
char **e, int *err) |
|
848 |
{
|
|
849 |
return (cs->cset->strntoull(cs, s, l, base, e, err)); |
|
850 |
}
|
|
851 |
||
852 |
||
853 |
inline static double my_strntod(const charset_info_st *cs, |
|
854 |
char* s, const size_t l, char **e, int *err) |
|
855 |
{
|
|
856 |
return (cs->cset->strntod(cs, s, l, e, err)); |
|
857 |
}
|
|
858 |
||
859 |
int make_escape_code(const charset_info_st * const cs, const char *escape); |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
860 |
|
861 |
} /* namespace drizzled */ |
|
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
862 |