48 #if !defined (SERVER_MODE) 58 #define EUC_SPACE 0xa1 59 #define ASCII_SPACE 0x20 71 #define LANG_CHAR_COUNT_EN 256 72 #define LANG_CHAR_COUNT_TR 352 74 #define LANG_COLL_GENERIC_SORT_OPT \ 75 {TAILOR_UNDEFINED, false, false, 1, false, CONTR_IGNORE, false, \ 76 MATCH_CONTR_BOUND_ALLOW} 77 #define LANG_COLL_NO_EXP 0, NULL, NULL, NULL 78 #define LANG_COLL_NO_CONTR NULL, 0, 0, NULL, 0, 0 80 #define LANG_NO_NORMALIZATION {NULL, 0, NULL, NULL, 0} 100 #define DEFAULT_COLL_OPTIONS {true, true, true} 101 #define CI_COLL_OPTIONS {false, false, true} 170 {
"ascii",
"US English charset - ASCII encoding",
" ",
"",
172 {
"raw-bits",
"Uninterpreted bits - Raw encoding",
"",
"",
174 {
"raw-bytes",
"Uninterpreted bytes - Raw encoding",
"",
"_binary",
176 {
"iso8859-1",
"Latin 1 charset - ISO 8859 encoding",
" ",
"_iso88591",
178 {
"ksc-euc",
"KSC 5601 1990 charset - EUC encoding",
"\241\241",
"_euckr",
180 {
"utf-8",
"UNICODE charset - UTF-8 encoding",
" ",
"_utf8",
190 #define LOCALE_DUMMY_ALPHABET(codeset) \ 191 {ALPHABET_TAILORED, (codeset), 0, 0, NULL, 0, NULL, false} 193 #define LOCALE_NULL_DATE_FORMATS NULL, NULL, NULL, NULL, NULL, NULL 196 #define LOCALE_NULL_CALENDAR_NAMES \ 197 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, \ 198 NULL, NULL, NULL, NULL, NULL 218 int size1,
const unsigned char *str2,
int size2,
const unsigned char *escape,
219 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space);
221 const unsigned char *string2,
const int size2,
bool ignore_trailing_space);
223 const unsigned char *string2,
const int size2,
bool ignore_trailing_space);
225 const unsigned char *str2,
int size2,
const unsigned char *escape,
226 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space);
228 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space);
230 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space);
232 const unsigned char *str2,
const int size2,
bool ignore_trailing_space);
234 const unsigned char *str2,
int size2,
const unsigned char *escape,
235 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space);
237 const unsigned char *str2,
const int size2,
bool ignore_trailing_space);
239 unsigned char **next_char,
bool ignore_trailing_space);
241 int size1,
const unsigned char *str2,
int size2,
const unsigned char *escape,
242 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space);
244 const int str_size,
unsigned int cp);
246 const int size,
UCA_L13_W ** uca_w_l13,
int *num_ce,
unsigned char **str_next,
247 unsigned int *cp_out);
249 const unsigned char *str_start,
const unsigned char *str_last,
250 UCA_L13_W ** uca_w_l13,
int *num_ce,
unsigned char **str_prev,
251 unsigned int *cp_out);
253 const int size,
UCA_L4_W ** uca_w_l4,
int *num_ce,
unsigned char **str_next,
254 unsigned int *cp_out);
256 const unsigned char *str1,
const int size1,
const unsigned char *str2,
257 const int size2,
const unsigned char *escape,
const bool has_last_escape,
258 int *offset_next_level,
int *str1_match_size,
bool ignore_trailing_space);
260 const int size1,
const unsigned char *str2,
const int size2,
261 const unsigned char *escape,
const bool has_last_escape,
262 int *offset_next_level,
int *str1_match_size,
263 bool ignore_trailing_space);
265 const unsigned char *str2,
const int size2,
bool ignore_trailing_space);
267 const int size1,
const unsigned char *str2,
const int size2,
268 const unsigned char *escape,
const bool has_last_escape,
int *str1_match_size,
269 bool ignore_trailing_space);
272 const unsigned char *str,
int size);
274 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space);
276 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space);
278 const int size1,
const unsigned char *str2,
const int size2,
const unsigned char **key,
279 int *byte_size,
bool ignore_trailing_space);
281 const int size1,
const unsigned char *str2,
const int size2,
const unsigned char **key,
282 int *byte_size,
bool ignore_trailing_space);
284 const int size1,
const unsigned char *str2,
const int size2,
285 const unsigned char **key,
int *byte_size,
bool ignore_trailing_space);
287 const int size1,
const unsigned char *str2,
const int size2,
const unsigned char **key,
288 int *byte_size,
bool ignore_trailing_space);
290 const int size1,
const unsigned char *str2,
const int size2,
const unsigned char **key,
291 int *byte_size,
bool ignore_trailing_space);
293 const int size1,
const unsigned char *str2,
const int size2,
const unsigned char **key,
294 int *byte_size,
bool ignore_trailing_space);
304 const unsigned char *string2,
int size2,
bool ignore_trailing_space);
306 const unsigned char *str2,
int size2,
const unsigned char *escape,
307 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space);
309 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space);
320 #if !defined(LANG_W_MAP_COUNT_EN) 321 #define LANG_W_MAP_COUNT_EN 256 343 "1bdb1b1f630edc508be37f66dfdce7b0"},
376 "707cef004e58be204d999d8a2abb4cc3"},
418 (
char *)
"6ae1bf7f15e6f132c4361761d203c1b4",
458 (
char *)
"945bead220ece6f4d020403835308785",
496 (
char *)
"b9ac135bdf8100b205ebb6b7e0e9c3df",
534 (
char *)
"8710ffb79b191c2158d4c498e8bc7dea",
549 "422c85ede1e265a761078763d2240c81"},
593 (
char *)
"802cff8e10d857952241d19b50a13a27",
609 "18fb633e87f0a3a785ef38cf2a6a7789"},
652 (
char *)
"c46ff948b4147323edfba0c51f96fe47",
667 "93fbdcc87193d2783b2396c6bec068bb"},
692 (
char *)
"390462b716493cbd74c77f545a77a2bf",
709 "54735f231842c3a673161fc90670989b"},
728 "d16a9a3825e263f76028c1e8c3cd043d"},
749 "b3fb4c073fbc76c5ec302da9128d9542"},
768 "3050bc8e9814b196f4bbb84759aab77c"},
787 "52f12f045d2fc90c3a818d0b334485d7"},
828 (
char *)
"a6c90a844ad44f78d0b1a3a9a87ddb2f",
872 for (i = 0; i < (int) (
sizeof (built_In_collations) /
sizeof (built_In_collations[0])); i++)
939 char *conv_sys_ids =
NULL;
942 char win_codepage_str[32];
950 #if !defined(WINDOWS) 951 (void) setlocale (LC_CTYPE,
"");
957 cp = GetConsoleCP ();
958 snprintf (win_codepage_str,
sizeof (win_codepage_str) - 1,
"%d", cp);
960 sys_id = win_codepage_str;
966 if (setlocale (LC_CTYPE,
"") !=
NULL)
968 sys_id = nl_langinfo (CODESET);
973 if (sys_id !=
NULL && conv_sys_ids !=
NULL)
975 char *conv_sys_end = conv_sys_ids +
strlen (conv_sys_ids);
981 found_token = strstr (conv_sys_ids, sys_id);
982 if (found_token ==
NULL)
987 if (found_token + strlen (sys_id) >= conv_sys_end || *(found_token + strlen (sys_id)) ==
',' 988 || *(found_token + strlen (sys_id)) ==
' ')
994 console_Conv = lang_Loc_data->
txt_conv;
999 conv_sys_ids = conv_sys_ids +
strlen (sys_id);
1002 while (conv_sys_ids < conv_sys_end);
1022 for (lang_Loc_data = lang_Loaded_locales[
lang_Lang_id]; lang_Loc_data !=
NULL;
1023 lang_Loc_data = lang_Loc_data->
next_lld)
1071 char *charset =
NULL;
1108 if (charset ==
NULL && strcasecmp (msg_lang,
"en_US") != 0)
1139 char *charset =
NULL;
1149 if (lang_charset !=
NULL)
1163 sprintf (err_msg,
"invalid value %s for charset",
lang_Loc_name);
1195 sprintf (err_msg,
"codeset %s for language %s is not supported", charset,
lang_Lang_name);
1241 "Internal error: must set charset first before setting " "language");
1276 charset = strchr (env_val,
'.');
1277 *charset_ptr = charset;
1278 if (charset !=
NULL)
1280 strncpy (lang_name, env_val, charset - env_val);
1281 lang_name[charset - env_val] =
'\0';
1308 strcpy (lang_name, env_val);
1311 if (
strlen (lang_name) == 5)
1321 memcpy (env_val, lang_name,
strlen (lang_name));
1366 while (lld !=
NULL);
1381 int num_user_loc = 0,
i;
1393 if (num_user_loc == 0)
1399 assert (num_user_loc > 0);
1409 for (
i = 0;
i < num_user_loc;
i++)
1415 bool is_new_locale =
false;
1429 loclib_Handle_count++;
1440 snprintf (err_msg,
sizeof (err_msg) - 1,
"Duplicate user locale : %s", lld->
lang_name);
1450 if (last_lang_locale !=
NULL)
1453 l_id = last_lang_locale->
lang_id;
1482 is_new_locale =
true;
1544 for (
i = 0;
i < num_user_loc;
i++)
1551 if (user_lf !=
NULL)
1583 snprintf (err_msg,
sizeof (err_msg) - 1,
1584 "Invalid collation numeric identifier : %d" " for collation '%s'. Expecting greater than %d and lower " 1596 snprintf (err_msg,
sizeof (err_msg) - 1,
1597 "Invalid collation numeric identifier : %d for collation '%s'" 1598 ". This id is already used by collation '%s'",
id, coll->
coll.
coll_name,
1604 lang_Collations[
id] = coll;
1626 if (name ==
NULL || *name ==
'\0')
1631 if (strchr (name, (
int)
' ') || strchr (name, (
int)
'\t'))
1636 for (i = 0; i < (int) (
sizeof (built_In_collations) /
sizeof (built_In_collations[0])); i++)
1638 if (strcasecmp (built_In_collations[i]->coll.coll_name, name) == 0)
1657 return lang_Collations[coll_id];
1690 if (strcmp (coll_name, lang_Collations[i]->coll.coll_name) == 0)
1692 return lang_Collations[
i];
1772 if (strcasecmp (lang_Loaded_locales[i]->
lang_name, name) == 0)
1774 first_lang_locale = lang_Loaded_locales[
i];
1779 for (curr_lang_locale = first_lang_locale; curr_lang_locale !=
NULL; curr_lang_locale = curr_lang_locale->
next_lld)
1781 if (codeset == curr_lang_locale->
codeset)
1783 found_lang_locale = curr_lang_locale;
1788 *last_lang_locale = curr_lang_locale;
1793 return found_lang_locale;
1817 if (new_lld ==
NULL)
1827 if (last_lang_locale ==
NULL)
1962 if (strcasecmp (lang_Loaded_locales[i]->
lang_name, locale_str) == 0)
2021 #if defined (ENABLE_UNUSED_FUNCTION) 2029 lang_char_mem_size (
const char *
p)
2048 lang_char_screen_size (
const char *
p)
2052 return (0x80 & (p[0]) ? 2 : 1);
2064 lang_wchar_mem_size (
const wchar_t *
p)
2068 if (0x8000 & (p[0]))
2083 lang_wchar_screen_size (
const wchar_t *
p)
2087 return (0x8000 & (p[0]) ? 2 : 1);
2114 for (i = 0; i < length && ok; i++)
2166 for (curr_lang_locale = first_lang_locale; curr_lang_locale !=
NULL;
2167 curr_lang_locale = curr_lang_locale->
next_lld)
2171 return curr_lang_locale;
2196 return lang_Loaded_locales[
lang];
2221 for (i = 0; i < (int) (
sizeof (builtin_Langs) /
sizeof (
LANG_DEFAULTS)); i++)
2223 if (strncasecmp (lang_name, builtin_Langs[i].lang_name,
strlen (builtin_Langs[i].lang_name)) == 0)
2225 *lang_id = builtin_Langs[
i].
lang;
2257 if (strcasecmp (lang_name, lang_Loaded_locales[i]->lang_name) == 0)
2259 assert (i == (
int) lang_Loaded_locales[i]->lang_id);
2260 *lang_id = lang_Loaded_locales[
i]->
lang_id;
2280 assert (lang_Loaded_locales[lang_id] !=
NULL);
2308 if (lang_str !=
NULL)
2343 int lang_val = (int) lang;
2347 *flag |= (has_user_format) ? 1 : 0;
2348 *flag |= (has_user_lang) ? 2 : 0;
2353 *flag |= lang_val << 2;
2357 *flag |= lang_val << 2;
2377 *has_user_format = ((flag & 0x1) == 0x1) ?
true :
false;
2378 *has_user_lang = ((flag & 0x2) == 0x2) ?
true :
false;
2380 lang_val = flag >> 2;
2409 const char *format =
NULL;
2410 const char *first_valid_format =
NULL;
2452 first_valid_format = format;
2456 if (first_valid_format ==
NULL)
2458 *format_codeset = lld->
codeset;
2459 first_valid_format = format;
2464 while (lld !=
NULL);
2466 return first_valid_format;
2483 if (intl_id == builtin_Langs[i].
lang)
2485 codeset = builtin_Langs[
i].
codeset;
2506 if (intl_id == builtin_Langs[i].
lang && codeset == builtin_Langs[i].codeset)
2569 if (codeset == lang_Db_charsets[i].charset_id)
2593 if (codeset == lang_Db_charsets[i].charset_id)
2621 snprintf (buf, buf_size,
"%s", lang_name);
2631 #if !defined (SERVER_MODE) 2690 if (strcmp (lang_Db_charsets[i].charset_name, name) == 0)
2710 if (coll_name !=
NULL)
2732 if (coll_name !=
NULL)
2781 if (strcasecmp (name, lang_Db_charsets[current_codeset].charset_cubrid_name) == 0)
2806 if (codeset == lang_Db_charsets[i].charset_id)
2829 const unsigned char *str2,
const int size2,
bool ignore_trailing_space)
2852 const unsigned char *str2,
int size2,
const unsigned char *escape,
const bool has_last_escape,
2853 int *str1_match_size,
bool ignore_trailing_space)
2855 const unsigned char *str1_end;
2856 const unsigned char *str2_end;
2857 const unsigned char *str1_begin;
2858 unsigned char *str1_next, *str2_next;
2859 unsigned int cp1, cp2, w_cp1, w_cp2;
2861 const unsigned int *weight_ptr = lang_coll->
coll.
weights;
2863 if (lang_coll->
built_in && ignore_trailing_space)
2869 str1_end = str1 + size1;
2870 str2_end = str2 + size2;
2872 for (; str1 < str1_end && str2 < str2_end;)
2874 assert (str1_end - str1 > 0);
2875 assert (str2_end - str2 > 0);
2880 if (is_match && escape !=
NULL && memcmp (str2, escape, str2_next - str2) == 0)
2882 if (!(has_last_escape && str2_next >= str2_end))
2889 if (cp1 < (
unsigned int) alpha_cnt)
2897 w_cp1 = weight_ptr[cp1];
2905 if (cp2 < (
unsigned int) alpha_cnt)
2913 w_cp2 = weight_ptr[cp2];
2923 return (w_cp1 < w_cp2) ? (-1) : 1;
2933 assert (size1 == 0 || size2 == 0);
2938 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
2947 if (is_match || !ignore_trailing_space)
2966 if (!ignore_trailing_space)
2992 const unsigned char *str2,
const int size2,
bool ignore_trailing_space)
2995 ignore_trailing_space);
3016 const unsigned char *str2,
int size2,
const unsigned char *escape,
3017 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space)
3019 const unsigned char *str1_end;
3020 const unsigned char *str2_end;
3021 const unsigned char *str1_begin;
3022 unsigned char *str1_next, *str2_next;
3023 unsigned int cp1, cp2, w_cp1, w_cp2;
3025 const int alpha_cnt = coll->
w_count;
3026 const unsigned int *weight_ptr = lang_coll->
coll.
weights;
3028 bool is_str1_contr =
false;
3029 bool is_str2_contr =
false;
3031 str1_end = str1 + size1;
3032 str2_end = str2 + size2;
3035 for (; str1 < str1_end && str2 < str2_end;)
3037 assert (str1_end - str1 > 0);
3038 assert (str2_end - str2 > 0);
3043 if (is_match && escape !=
NULL && memcmp (str2, escape, str2_next - str2) == 0)
3045 if (!(has_last_escape && str2_next >= str2_end))
3052 is_str1_contr = is_str2_contr =
false;
3054 if (cp1 < (
unsigned int) alpha_cnt)
3065 str1_next = (
unsigned char *) str1 + contr->
size;
3066 is_str1_contr =
true;
3070 w_cp1 = weight_ptr[cp1];
3078 if (cp2 < (
unsigned int) alpha_cnt)
3089 str2_next = (
unsigned char *) str2 + contr->
size;
3090 is_str2_contr =
true;
3094 w_cp2 = weight_ptr[cp2];
3106 if (cp1 < (
unsigned int) alpha_cnt)
3108 w_cp1 = weight_ptr[cp1];
3119 return (w_cp1 < w_cp2) ? (-1) : 1;
3129 assert (size1 == 0 || size2 == 0);
3134 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
3143 if (is_match || !ignore_trailing_space)
3163 if (!ignore_trailing_space)
3178 #define ADD_TO_HASH(pseudo_key, w) \ 3181 pseudo_key = (pseudo_key << 4) + w; \ 3182 i = pseudo_key & 0xf0000000; \ 3185 pseudo_key ^= i >> 24; \ 3202 const unsigned char *str_end;
3203 unsigned char *str_next;
3206 const int alpha_cnt = coll->
w_count;
3207 const unsigned int *weight_ptr = lang_coll->
coll.
weights;
3208 unsigned int pseudo_key = 0;
3210 str_end = str + size;
3212 for (; str < str_end;)
3214 assert (str_end - str > 0);
3218 if (cp < (
unsigned int) alpha_cnt)
3229 str_next = (
unsigned char *) str + contr->
size;
3264 bool ignore_trailing_space)
3267 const int alpha_cnt = coll->
w_count;
3268 const unsigned int *weight_ptr = coll->
weights;
3275 if (cp < (
unsigned int) alpha_cnt)
3286 *next_char = (
unsigned char *) str + contr->
size;
3319 const int *first_contr;
3339 assert (contr_id >= 0 && contr_id < coll_data->count_contr);
3344 if ((
int) contr->
size > str_size)
3346 cmp = memcmp (contr->
c_buf, str, str_size);
3354 cmp = memcmp (contr->
c_buf, str, contr->
size);
3368 while (contr_id < coll_data->count_contr);
3398 UCA_L13_W ** uca_w_l13,
int *num_ce,
unsigned char **str_next,
unsigned int *cp_out)
3401 const int alpha_cnt = coll_data->
w_count;
3410 if (cp < (
unsigned int) alpha_cnt)
3422 *str_next = (
unsigned char *) str + contr->
size;
3427 *uca_w_l13 = &(coll_data->
uca_w_l13[cp * exp_num]);
3428 *num_ce = coll_data->
uca_num[cp];
3459 const unsigned char *str_last,
UCA_L13_W ** uca_w_l13,
int *num_ce,
3460 unsigned char **str_prev,
unsigned int *cp_out)
3463 const int alpha_cnt = coll_data->
w_count;
3468 assert (str_start <= str_last);
3473 if (cp < (
unsigned int) alpha_cnt)
3476 unsigned int cp_prev;
3477 unsigned char *str_prev_prev =
NULL;
3479 if (*str_prev >= str_start)
3483 if (use_contractions && coll_data->
count_contr > 0 && cp_prev < (
unsigned int) alpha_cnt
3492 *str_prev = str_prev_prev;
3498 *uca_w_l13 = &(coll_data->
uca_w_l13[cp * exp_num]);
3499 *num_ce = coll_data->
uca_num[cp];
3528 UCA_L4_W ** uca_w_l4,
int *num_ce,
unsigned char **str_next,
unsigned int *cp_out)
3531 const int alpha_cnt = coll_data->
w_count;
3538 if (cp < (
unsigned int) alpha_cnt)
3550 *str_next = (
unsigned char *) str + contr->
size;
3555 *uca_w_l4 = &(coll_data->
uca_w_l4[cp * exp_num]);
3556 *num_ce = coll_data->
uca_num[cp];
3574 #define GET_UCA_WEIGHT(l, i, l13w, l4w) \ 3575 ((l == 0) ? (UCA_GET_L1_W (l13w[i])) : \ 3576 (l == 1) ? (UCA_GET_L2_W (l13w[i])) : \ 3577 (l == 2) ? (UCA_GET_L3_W (l13w[i])) : (l4w[i])) 3579 #define INTL_CONTR_FOUND(v) (((v) & INTL_MASK_CONTR) == INTL_MASK_CONTR) 3604 const int size1,
const unsigned char *str2,
const int size2,
3605 const unsigned char *escape,
const bool has_last_escape,
int *offset_next_level,
3606 int *str1_match_size,
bool ignore_trailing_space)
3608 const unsigned char *str1_end;
3609 const unsigned char *str2_end;
3610 const unsigned char *str1_begin;
3611 unsigned char *str1_next, *str2_next;
3616 int num_ce1 = 0, num_ce2 = 0;
3617 int ce_index1 = 0, ce_index2 = 0;
3618 unsigned int w1 = 0, w2 = 0;
3620 bool compute_offset =
false;
3621 unsigned int str1_cp_contr = 0, str2_cp_contr = 0;
3626 assert (offset_next_level !=
NULL && *offset_next_level > -1);
3627 assert (level >= 0 && level <= 4);
3629 str1_end = str1 + size1;
3630 str2_end = str2 + size2;
3635 assert (*offset_next_level == 0);
3636 compute_offset =
true;
3640 cmp_offset = *offset_next_level;
3643 assert (cmp_offset <= size1);
3644 assert (cmp_offset <= size2);
3649 compute_offset =
false;
3652 str1_next = (
unsigned char *) str1;
3653 str2_next = (
unsigned char *) str2;
3661 if (str1 >= str1_end)
3669 &str1_next, &str1_cp_contr);
3674 &str1_next, &str1_cp_contr);
3687 if (str2 >= str2_end)
3694 if (!(has_last_escape && str2 + c_size >= str2_end))
3703 &str2_next, &str1_cp_contr);
3708 &str2_next, &str2_cp_contr);
3719 &str1_next, &str1_cp_contr);
3724 &str1_next, &str1_cp_contr);
3736 if (ce_index1 == 0 && ce_index2 == 0)
3745 compute_offset =
false;
3748 else if (ce_index1 != ce_index2)
3750 compute_offset =
false;
3755 if (num_ce1 == 0 && str1 >= str1_end)
3760 if (str2 >= str2_end)
3768 if (is_match || !ignore_trailing_space)
3785 if (!ignore_trailing_space)
3804 while (num_ce2 > 0);
3809 if (num_ce2 == 0 && str2 >= str2_end)
3817 if (!ignore_trailing_space)
3882 if (str2 < str2_end)
3884 assert (str1 == str1_end);
3885 if (ignore_trailing_space)
3897 else if (str1 < str1_end)
3899 assert (str2 == str2_end);
3900 if (ignore_trailing_space)
3914 assert (str2 == str2_end && str1 == str1_end);
3916 if (num_ce1 > num_ce2)
3920 else if (num_ce1 < num_ce2)
3930 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
3935 *offset_next_level = cmp_offset;
3964 const unsigned char *str_end;
3965 unsigned char *str_next;
3972 const int alpha_cnt = coll_data->
w_count;
3974 unsigned int pseudo_key = 0;
3978 str_end = str + size;
3980 str_next = (
unsigned char *) str;
3995 if (cp < (
unsigned int) alpha_cnt)
4011 str_next = (
unsigned char *) str + contr->
size;
4015 uca_w_l13 = &(coll_data->
uca_w_l13[cp * exp_num]);
4018 uca_w_l4 = &(coll_data->
uca_w_l4[cp * exp_num]);
4020 num_ce = coll_data->
uca_num[cp];
4040 if (num_ce == 0 && str >= str_end)
4083 const int size1,
const unsigned char *str2,
const int size2,
4084 const unsigned char *escape,
const bool has_last_escape,
int *offset_next_level,
4085 int *str1_match_size,
bool ignore_trailing_space)
4087 const unsigned char *str1_start;
4088 const unsigned char *str2_start;
4089 const unsigned char *str1_last;
4090 const unsigned char *str2_last;
4091 unsigned char *str1_prev, *str2_prev;
4094 int num_ce1 = 0, num_ce2 = 0;
4095 int ce_index1 = -1, ce_index2 = -1;
4096 unsigned int w1 = 0, w2 = 0;
4097 unsigned int str1_cp_contr = 0, str2_cp_contr = 0;
4100 assert (offset_next_level !=
NULL && *offset_next_level > -1);
4102 str1_last = str1 + size1 - 1;
4103 str2_last = str2 + size2 - 1;
4117 str1_prev = (
unsigned char *) str1_last;
4118 str2_prev = (
unsigned char *) str2_last;
4126 if (str1 < str1_start)
4136 ce_index1 = num_ce1 - 1;
4145 if (str2 < str2_start)
4150 if (is_match && escape !=
NULL && !(has_last_escape && str2 == str2_last))
4152 unsigned char *str2_prev_prev;
4158 str2 = str2_prev_prev;
4167 ce_index2 = num_ce2 - 1;
4178 ce_index1 = num_ce1 - 1;
4183 if (ce_index1 < 0 && str1 < str1_start)
4188 if (str2 < str2_start)
4196 if (is_match || !ignore_trailing_space)
4206 if (is_match || !ignore_trailing_space)
4225 while (ce_index2 > 0);
4230 if (ce_index2 < 0 && str2 < str2_start)
4238 if (!ignore_trailing_space)
4244 while (ce_index1 >= 0)
4259 assert (ce_index1 >= 0 && ce_index2 >= 0);
4296 if (str1 > str1_start)
4298 assert (str2 <= str2_start);
4301 else if (str2 > str2_start)
4303 assert (str1 <= str1_start);
4308 if (ce_index1 > ce_index2)
4313 else if (ce_index1 < ce_index2)
4324 *str1_match_size =
CAST_BUFLEN (str1_last - str1_start) + 1;
4342 const unsigned char *str2,
const int size2,
bool ignore_trailing_space)
4345 ignore_trailing_space);
4364 const unsigned char *str2,
const int size2,
const unsigned char *escape,
4365 const bool has_last_escape,
int *str1_match_size,
bool ignore_trailing_space)
4368 has_last_escape, str1_match_size, ignore_trailing_space);
4390 const int size1,
const unsigned char *str2,
const int size2,
4391 const unsigned char *escape,
const bool has_last_escape,
int *str1_match_size,
4392 bool ignore_trailing_space)
4400 &cmp_offset, str1_match_size, ignore_trailing_space);
4413 &cmp_offset, str1_match_size, ignore_trailing_space);
4428 int str1_level_2_size;
4432 str1_level_2_size = *str1_match_size;
4436 str1_level_2_size = size1;
4438 if (str1_level_2_size > 0 && size2 > 0)
4442 has_last_escape, &cmp_offset, str1_match_size, ignore_trailing_space);
4446 res = (str1_level_2_size == size2) ? 0 : ((str1_level_2_size > size2) ? 1 : -1);
4453 &cmp_offset, str1_match_size, ignore_trailing_space);
4469 &cmp_offset, str1_match_size, ignore_trailing_space);
4484 &cmp_offset, str1_match_size, ignore_trailing_space);
4506 unsigned char *str_next;
4514 if (cp >= (
unsigned int) lang_coll->
coll.
w_count || weight[cp] != 0)
4542 unsigned char *str_next;
4547 str_next = (
unsigned char *) str;
4556 lang_get_uca_w_l4 (coll_data,
true, str, size, &uca_w_l4, &num_ce, &str_next, &dummy);
4560 lang_get_uca_w_l13 (coll_data,
true, str, size, &uca_w_l13, &num_ce, &str_next, &dummy);
4597 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space)
4599 unsigned int cp_alpha_char, cp_next_alpha_char;
4603 unsigned char *dummy =
NULL;
4612 if (cp_alpha_char < (
unsigned int) alpha_cnt)
4614 cp_next_alpha_char = next_alpha_char[cp_alpha_char];
4618 cp_next_alpha_char = cp_alpha_char + 1;
4641 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space)
4643 unsigned int cp_first_char;
4644 unsigned int next_seq_id;
4645 unsigned int cp_next_char;
4649 unsigned char *dummy =
NULL;
4659 if (cp_first_char < (
unsigned int) alpha_cnt)
4669 next_seq_id = next_alpha_char[cp_first_char];
4673 next_seq_id = contr->next;
4679 memcpy (next_seq, contr->c_buf, contr->size);
4680 *len_next = contr->cp_count;
4685 cp_next_char = next_seq_id;
4691 cp_next_char = cp_first_char + 1;
4716 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
4717 bool ignore_trailing_space)
4719 const unsigned char *str1_end, *str2_end;
4720 const unsigned char *str1_begin, *str2_begin;
4727 str1_end = str1 + size1;
4728 str2_end = str2 + size2;
4732 for (; str1 < str1_end && str2 < str2_end; str1++, str2++)
4736 assert ((!is_desc && *str1 < *str2) || (is_desc && *str1 > *str2));
4743 *key = (
unsigned char *) str2_begin;
4746 while (str2 < str2_end)
4748 if (weight[*str2++] !=
ZERO)
4753 assert (str2 <= str2_end);
4761 while (str1 < str1_end)
4763 if (weight[*str1++] !=
ZERO)
4769 if (str1 >= str1_end)
4772 *key = (
unsigned char *) str2_begin;
4777 assert (str1 < str1_end);
4778 *key = (
unsigned char *) str1_begin;
4783 *byte_size = key_size;
4807 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
4808 bool ignore_trailing_space)
4810 const unsigned char *str1_end, *str2_end;
4811 const unsigned char *str1_begin, *str2_begin;
4812 unsigned int w1, w2;
4819 str1_end = str1 + size1;
4820 str2_end = str2 + size2;
4824 for (; str1 < str1_end && str2 < str2_end; str1++, str2++)
4831 assert ((!is_desc && w1 < w2) || (is_desc && w1 > w2));
4838 *key = (
unsigned char *) str2_begin;
4841 while (str2 < str2_end)
4843 if (weight[*str2++] != 0)
4855 while (str1 < str1_end)
4857 if (weight[*str1++] != 0)
4863 if (str1 >= str1_end)
4866 *key = (
unsigned char *) str2_begin;
4871 assert (str1 < str1_end);
4872 *key = (
unsigned char *) str1_begin;
4877 *byte_size = key_size;
4900 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
4901 bool ignore_trailing_space)
4903 const unsigned char *str1_end, *str2_end;
4904 const unsigned char *str1_begin, *str2_begin;
4905 unsigned char *str1_next, *str2_next;
4906 unsigned int w1, w2;
4913 str1_end = str1 + size1;
4914 str2_end = str2 + size2;
4918 for (; str1 < str1_end && str2 < str2_end;)
4925 assert ((!is_desc && w1 < w2) || (is_desc && w1 > w2));
4935 *key = (
unsigned char *) str2_begin;
4938 while (str2 < str2_end)
4948 assert (str2 <= str2_end);
4955 while (str1 < str1_end)
4965 if (str1 >= str1_end)
4968 *key = (
unsigned char *) str2_begin;
4973 assert (str1 < str1_end);
4974 *key = (
unsigned char *) str1_begin;
4979 *byte_size = key_size;
5002 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
5003 bool ignore_trailing_space)
5005 const unsigned char *str1_end;
5006 const unsigned char *str2_end;
5007 unsigned char *str1_next, *str2_next;
5008 unsigned char *str1_begin, *str2_begin;
5011 int num_ce1 = 0, num_ce2 = 0;
5012 int ce_index1 = 0, ce_index2 = 0;
5013 unsigned int w1 = 0, w2 = 0;
5017 bool force_key =
false;
5022 str1_begin = str1_next = (
unsigned char *) str1;
5023 str2_begin = str2_next = (
unsigned char *) str2;
5025 str1_end = str1 + size1;
5026 str2_end = str2 + size2;
5036 if (str1 >= str1_end)
5052 if (str2 >= str2_end)
5066 if ((num_ce1 == 0 && str1 >= str1_end) || (num_ce2 == 0 && str2 >= str2_end))
5098 assert ((is_desc && w1 > w2) || (!is_desc && w1 < w2));
5120 *key = (
unsigned char *) str2_begin;
5123 while (str2 < str2_end)
5135 assert (str2 <= str2_end);
5142 while (str1 < str1_end)
5154 if (str1 >= str1_end)
5157 *key = (
unsigned char *) str2_begin;
5162 assert (str1 < str1_end);
5163 *key = (
unsigned char *) str1_begin;
5168 *byte_size = key_size;
5190 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
5191 bool ignore_trailing_space)
5193 const unsigned char *str1_next, *str2_next;
5194 int key_size, char1_size, char2_size;
5195 const unsigned char *str1_end, *str2_end;
5196 const unsigned char *str1_begin, *str2_begin;
5202 str1_end = str1 + size1;
5203 str2_end = str2 + size2;
5207 for (; str1 < str1_end && str2 < str2_end;)
5212 if (char1_size != char2_size || memcmp (str1, str2, char1_size) != 0)
5223 *key = (
unsigned char *) str2_begin;
5226 while (str2 < str2_end)
5228 bool is_zero_weight =
false;
5232 is_zero_weight = (weight[
SPACE] == 0);
5235 if (!is_zero_weight)
5241 assert (str2 <= str2_end);
5249 while (str1 < str1_end)
5251 bool is_zero_weight =
false;
5255 is_zero_weight = (weight[
SPACE] == 0);
5258 if (!is_zero_weight)
5264 if (str1 >= str1_end)
5267 *key = (
unsigned char *) str2_begin;
5272 assert (str1 < str1_end);
5273 *key = (
unsigned char *) str1_begin;
5278 *byte_size = key_size;
5329 static bool is_common_en_cs_init =
false;
5331 if (is_common_en_cs_init)
5336 for (i = 0; i < coll_data->
w_count; i++)
5345 is_common_en_cs_init =
true;
5359 static bool is_common_en_ci_init =
false;
5361 if (is_common_en_ci_init)
5366 for (i = 0; i < coll_data->
w_count; i++)
5372 for (i =
'a'; i <= (int)
'z'; i++)
5389 is_common_en_ci_init =
true;
5456 for (i = (
int)
'a'; i <= (int)
'z'; i++)
5497 const unsigned char *string2,
const int size2,
bool ignore_trailing_space)
5500 unsigned int c1, c2;
5504 n = size1 < size2 ? size1 : size2;
5505 for (i = 0, cmp = 0; i < n && cmp == 0; i++)
5530 if (cmp || size1 == size2)
5535 if (!ignore_trailing_space && size1 != size2)
5537 return size1 - size2;
5544 for (i = 0; i < n && cmp == 0; i++)
5546 c2 = weight[*string2++];
5553 for (i = 0; i < n && cmp == 0; i++)
5555 c1 = weight[*string1++];
5581 const unsigned char *str2,
int size2,
const unsigned char *escape,
const bool has_last_escape,
5582 int *str1_match_size,
bool ignore_trailing_space)
5584 unsigned int c1, c2;
5585 const unsigned char *str1_end;
5586 const unsigned char *str2_end;
5587 const unsigned char *str1_begin;
5592 str1_end = str1 + size1;
5593 str2_end = str2 + size2;
5594 for (; str1 < str1_end && str2 < str2_end;)
5596 assert (str1_end - str1 > 0);
5597 assert (str2_end - str2 > 0);
5611 if (is_match && escape !=
NULL && c2 == *escape)
5613 if (!(has_last_escape && str2 + 1 >= str2_end))
5623 if (c1 < (
unsigned int) alpha_cnt)
5628 if (c2 < (
unsigned int) alpha_cnt)
5642 assert (size1 == 0 || size2 == 0);
5647 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
5661 for (; str2 < str2_end;)
5663 c2 = weight[*str2++];
5679 for (; str1 < str1_end;)
5681 c1 = weight[*str1++];
5716 const unsigned char *str_end = str + size;
5717 unsigned int pseudo_key = 0;
5720 for (; str < str_end; str++)
5741 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space)
5748 *next_seq = (*seq == 0xff) ? 0xff : (*seq + 1);
5766 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space)
5768 unsigned int cp_alpha_char, cp_next_alpha_char;
5777 cp_alpha_char = (
unsigned int) *seq;
5779 if (cp_alpha_char < (
unsigned int) alpha_cnt)
5781 cp_next_alpha_char = next_alpha_char[cp_alpha_char];
5785 cp_next_alpha_char = (cp_alpha_char == 0xff) ? 0xff : (cp_alpha_char + 1);
5788 assert (cp_next_alpha_char <= 0xff);
5790 *next_seq = (
unsigned char) cp_next_alpha_char;
5815 const unsigned int special_upper_cp[] = {
5824 const unsigned int special_prev_upper_cp[] = {
'C',
'G',
'I',
'O',
'S',
'U' };
5826 const unsigned int special_lower_cp[] = {
5835 const unsigned int special_prev_lower_cp[] = {
'c',
'g',
'h',
'o',
's',
'u' };
5845 lang_Next_alpha_char_TR = lang_coll->
coll.
next_cp;
5852 lang_Weight_TR[
i] =
i;
5853 lang_Next_alpha_char_TR[
i] = i + 1;
5854 lang_Weight_TR_ti[
i] =
i;
5855 lang_Next_alpha_char_TR_ti[
i] = i + 1;
5858 assert (DIM (special_lower_cp) == DIM (special_upper_cp));
5861 for (i = 0; i < (int) DIM (special_upper_cp); i++)
5864 unsigned int cp = special_upper_cp[
i];
5865 unsigned cp_repl = 1 + special_prev_upper_cp[
i];
5866 unsigned int w_repl = lang_Weight_TR[cp_repl];
5868 lang_Weight_TR[cp] = w_repl;
5869 lang_Weight_TR_ti[cp] = w_repl;
5872 for (j = cp_repl; j < cp; j++)
5874 if (lang_Weight_TR[j] >= w_repl)
5876 (lang_Weight_TR[j])++;
5877 (lang_Weight_TR_ti[j])++;
5882 for (i = 0; i < (int) DIM (special_lower_cp); i++)
5885 unsigned int cp = special_lower_cp[
i];
5886 unsigned cp_repl = 1 + special_prev_lower_cp[
i];
5887 unsigned int w_repl = lang_Weight_TR[cp_repl];
5889 lang_Weight_TR[cp] = w_repl;
5890 lang_Weight_TR_ti[cp] = w_repl;
5893 for (j = cp_repl; j < cp; j++)
5895 if (lang_Weight_TR[j] >= w_repl)
5897 (lang_Weight_TR[j])++;
5898 (lang_Weight_TR_ti[j])++;
5904 for (i = 0; i < (int) DIM (special_upper_cp); i++)
5906 unsigned int cp_special = special_upper_cp[
i];
5907 unsigned int cp_prev = special_prev_upper_cp[
i];
5908 unsigned int cp_next = cp_prev + 1;
5910 lang_Next_alpha_char_TR[cp_prev] = cp_special;
5911 lang_Next_alpha_char_TR[cp_special] = cp_next;
5912 lang_Next_alpha_char_TR_ti[cp_prev] = cp_special;
5913 lang_Next_alpha_char_TR_ti[cp_special] = cp_next;
5916 for (i = 0; i < (int) DIM (special_lower_cp); i++)
5918 unsigned int cp_special = special_lower_cp[
i];
5919 unsigned int cp_prev = special_prev_lower_cp[
i];
5920 unsigned int cp_next = cp_prev + 1;
5922 lang_Next_alpha_char_TR[cp_prev] = cp_special;
5923 lang_Next_alpha_char_TR[cp_special] = cp_next;
5924 lang_Next_alpha_char_TR_ti[cp_prev] = cp_special;
5925 lang_Next_alpha_char_TR_ti[cp_special] = cp_next;
5928 lang_Weight_TR_ti[32] = 0;
5929 lang_Next_alpha_char_TR_ti[32] = 1;
5960 const unsigned int special_upper_cp[] = {
5969 const unsigned int special_lower_cp[] = {
5989 for (i = (
int)
'a'; i <= (int)
'z'; i++)
5998 assert (DIM (special_lower_cp) == DIM (special_upper_cp));
6000 for (i = 0; i < (int) DIM (special_lower_cp); i++)
6100 const unsigned char *string2,
int size2,
bool ignore_trailing_space)
6103 unsigned char c1, c2;
6104 const unsigned char *str1_end;
6105 const unsigned char *str2_end;
6108 assert (size1 >= 0 && size2 >= 0);
6110 str1_end = string1 + size1;
6111 str2_end = string2 + size2;
6113 for (cmp = 0; string1 < str1_end && string2 < str2_end && cmp == 0;)
6147 assert (size1 == 0 || size2 == 0);
6157 assert (size1 == 0 && size2 > 0);
6159 for (; string2 < str2_end && c2 ==
ZERO;)
6175 assert (size1 > 0 && size2 == 0);
6177 for (; string1 < str1_end && c1 ==
ZERO;)
6207 const unsigned char *str_end;
6208 unsigned int pseudo_key = 0;
6213 str_end = str + size;
6217 while (str_end > str)
6224 else if (str_end > str + 1 && *(str_end - 1) ==
EUC_SPACE && *(str_end - 2) ==
EUC_SPACE)
6233 for (; str < str_end;)
6272 const unsigned char *str2,
int size2,
const unsigned char *escape,
const bool has_last_escape,
6273 int *str1_match_size,
bool ignore_trailing_space)
6275 const unsigned char *str1_end;
6276 const unsigned char *str2_end;
6277 const unsigned char *str1_next;
6278 const unsigned char *str2_next;
6279 const unsigned char *str1_begin;
6280 int char1_size, char2_size,
cmp = 0;
6281 unsigned int c1, c2;
6283 assert (size1 >= 0 && size2 >= 0);
6286 str1_end = str1 + size1;
6287 str2_end = str2 + size2;
6289 for (; str1 < str1_end && str2 < str2_end;)
6291 assert (str1_end - str1 > 0);
6292 assert (str2_end - str2 > 0);
6297 if (is_match && escape !=
NULL && memcmp (str2, escape, char2_size) == 0)
6299 if (!(has_last_escape && str2_next >= str2_end))
6318 if (c1 == c2 && c1 == 0)
6322 else if (char1_size != char2_size)
6324 return (char1_size < char2_size) ? (-1) : 1;
6328 cmp = memcmp (str1, str2, char1_size);
6345 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
6348 assert (size1 == 0 || size2 == 0);
6362 for (; str2 < str2_end;)
6390 for (; str1 < str1_end;)
6423 unsigned char *next_seq,
int *len_next,
bool ignore_trailing_space)
6432 memcpy (next_seq, seq, char_size);
6437 if ((char_size == 1 && *next_seq < 0x7f) || (char_size > 1 && next_seq[char_size - 1] < 0xff))
6439 next_seq[char_size - 1]++;
6459 const unsigned char *string2,
const int size2,
bool ignore_trailing_space)
6463 size = size1 < size2 ? size1 : size2;
6464 for (i = 0; i < size; i++, string1++, string2++)
6467 if (*string1 > *string2)
6471 else if (*string1 < *string2)
6479 size = size2 - size1;
6480 for (i = 0; i < size; i++)
6489 else if (size1 > size2)
6491 size = size1 - size2;
6492 for (i = 0; i < size; i++)
6524 const unsigned char *str2,
int size2,
const unsigned char *escape,
const bool has_last_escape,
6525 int *str1_match_size,
bool ignore_trailing_space)
6527 unsigned int c1, c2;
6528 const unsigned char *str1_end;
6529 const unsigned char *str2_end;
6530 const unsigned char *str1_begin;
6533 str1_end = str1 + size1;
6534 str2_end = str2 + size2;
6535 for (; str1 < str1_end && str2 < str2_end; str1++, str2++)
6537 assert (str1_end - str1 > 0);
6538 assert (str2_end - str2 > 0);
6543 if (is_match && escape !=
NULL && c2 == *escape)
6546 if (!(has_last_escape && str2 + 1 >= str2_end))
6554 return (c1 < c2) ? -1 : 1;
6561 assert (size1 == 0 || size2 == 0);
6566 *str1_match_size =
CAST_BUFLEN (str1 - str1_begin);
6580 for (; str2 < str2_end; str2++)
6597 for (; str1 < str1_end; str1++)
6626 const unsigned char *str2,
const int size2,
const unsigned char **key,
int *byte_size,
6627 bool ignore_trailing_space)
6629 const unsigned char *str1_end, *str2_end;
6630 const unsigned char *str1_begin, *str2_begin;
6636 str1_end = str1 + size1;
6637 str2_end = str2 + size2;
6641 for (; str1 < str1_end && str2 < str2_end; str1++, str2++)
6645 assert ((!is_desc && *str1 < *str2) || (is_desc && *str1 > *str2));
6652 *key = (
unsigned char *) str2_begin;
6655 while (str2 < str2_end)
6662 assert (str2 <= str2_end);
6670 while (str1 < str1_end)
6678 if (str1 >= str1_end)
6681 *key = (
unsigned char *) str2_begin;
6686 assert (str1 < str1_end);
6687 *key = (
unsigned char *) str1_begin;
6692 *byte_size = key_size;
6698 #if defined(WINDOWS) 6699 #define GET_SYM_ADDR(lib, sym) GetProcAddress((HMODULE)lib, sym) 6701 #define GET_SYM_ADDR(lib, sym) dlsym(lib, sym) 6704 #define SHLIB_GET_ADDR(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME) \ 6706 if (snprintf (sym_name, LOC_LIB_SYMBOL_NAME_SIZE - 1, "" SYM_NAME "_%s", LOC_NAME) < 0) \ 6707 goto error_loading_symbol; \ 6708 v = (SYM_TYPE) GET_SYM_ADDR (lh, sym_name); \ 6711 goto error_loading_symbol; \ 6715 #define SHLIB_GET_ADDR_W_REF(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME) \ 6717 snprintf (sym_name, LOC_LIB_SYMBOL_NAME_SIZE, "" SYM_NAME "_ref_%s", \ 6719 temp_char_sym = (char *) GET_SYM_ADDR (lh, sym_name); \ 6720 if (temp_char_sym == NULL) \ 6722 goto error_loading_symbol; \ 6724 strcpy (sym_name, temp_char_sym); \ 6725 v = (SYM_TYPE) GET_SYM_ADDR (lh, sym_name); \ 6728 goto error_loading_symbol; \ 6732 #define SHLIB_GET_VAL(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME) \ 6735 SHLIB_GET_ADDR(aux, SYM_NAME, SYM_TYPE*, lh, LOC_NAME); \ 6754 char **temp_array_sym;
6757 int i, count_coll_to_load;
6758 const char *alpha_suffix =
NULL;
6759 bool load_w_identifier_name;
6761 bool sym_loc_name_found =
false;
6769 sym_loc_name_found =
true;
6774 snprintf (err_msg,
sizeof (err_msg) - 1,
"invalid checksum in locale" " library %s", lf->
lib_file);
6814 lld->
am_pm[
i] = temp_array_sym[
i];
6843 alpha_suffix =
"unicode";
6847 alpha_suffix =
"ascii";
6864 load_w_identifier_name =
false;
6867 alpha_suffix =
"unicode";
6871 alpha_suffix =
"ascii";
6876 load_w_identifier_name =
true;
6903 unsigned char *is_lead_byte;
6944 if (is_load_for_dump)
6955 for (i = 0; i < count_coll_to_load; i++)
6958 char *collation_name =
NULL;
6975 if (lang_coll ==
NULL)
6986 coll = &(lang_coll->
coll);
7057 error_loading_symbol:
7058 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7060 if (!sym_loc_name_found)
7063 "\n Locale might not be compiled into the selected " "library.\n Check configuration and recompile locale" 7064 ", if necessary,\n using the make_locale script");
7095 error_loading_symbol:
7096 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7126 snprintf (coll_suffix,
sizeof (coll_suffix) - 1,
"%d_%s", coll_pos, lf->
locale_name);
7127 SHLIB_GET_ADDR (*coll_name,
"collation",
char *, lib_handle, coll_suffix);
7131 error_loading_symbol:
7132 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7151 char *temp_char_sym;
7155 char *coll_checksum =
NULL;
7164 if (strcmp (temp_char_sym, cd->
coll_name))
7167 snprintf (err_msg,
sizeof (err_msg) - 1,
"Collation %s not found in shared library %s", cd->
coll_name,
7174 strncpy (cd->
checksum, coll_checksum, 32);
7241 error_loading_symbol:
7242 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7272 if (load_w_identifier_name)
7299 error_loading_symbol:
7300 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7319 #if defined(WINDOWS) 7322 UINT error_mode = 0;
7329 #if defined(WINDOWS) 7330 error_mode = SetErrorMode (SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
7331 *handle = LoadLibrary (lib_file);
7332 SetErrorMode (error_mode);
7333 loading_err = GetLastError ();
7336 *handle = dlopen (lib_file, RTLD_NOW);
7339 if (*handle ==
NULL)
7342 #if defined(WINDOWS) 7343 FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
NULL,
7344 loading_err, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (
char *) &lpMsgBuf, 1,
7345 (va_list *) & lib_file);
7346 snprintf (err_msg,
sizeof (err_msg) - 1,
7347 "Library file is invalid or not accessible.\n" " Unable to load %s !\n %s", lib_file, lpMsgBuf);
7348 LocalFree (lpMsgBuf);
7351 snprintf (err_msg,
sizeof (err_msg) - 1,
7352 "Library file is invalid or not accessible.\n" " Unable to load %s !\n %s", lib_file, error);
7372 #if defined(WINDOWS) 7381 loclib_Handle_count = 0;
7398 lang_Loaded_locales[
i] =
NULL;
7401 lang_Count_locales = 0;
7428 error_loading_symbol:
7429 snprintf (err_msg,
sizeof (err_msg) - 1,
"Cannot load symbol %s from the library file %s " "for the %s locale!",
7454 generic_Unicode_norm = norm;
7472 if (!(lang_Collations[i]->built_in))
7474 free (lang_Collations[i]);
7476 lang_Collations[
i] =
NULL;
7496 const char *server_text)
7509 snprintf (err_msg,
sizeof (err_msg) - 1,
7510 "Number of collations do not match : " "%s has %d collations, %s has %d collations", client_text,
7517 for (i = 0; i < coll_cnt; i++)
7522 ref_c = &(coll_array[
i]);
7530 snprintf (err_msg,
sizeof (err_msg) - 1,
7531 "Collation '%s' with id %d from %s not found with the " "same id on %s", ref_c->
coll_name,
7532 ref_c->
coll_id, server_text, client_text);
7540 snprintf (err_msg,
sizeof (err_msg) - 1,
7541 "Names of collation with id %d do not match : " "on %s, is '%s'; on %s, is '%s'", ref_c->
coll_id,
7550 snprintf (err_msg,
sizeof (err_msg) - 1,
7551 "Codesets of collation '%s' with id %d do not match : " 7552 "on %s, codeset is %d; on %s, codeset is %d", ref_c->
coll_name, ref_c->
coll_id, client_text,
7561 snprintf (err_msg,
sizeof (err_msg) - 1,
7562 "Collation '%s' with id %d has changed : " "on %s, checksum is '%s'; on %s, checksum is '%s'",
7585 const char *server_text)
7602 bool ref_found =
false;
7604 for (j = 0; j < loc_cnt; j++)
7606 ref_loc = &(loc_array[j]);
7617 snprintf (err_msg,
sizeof (err_msg) - 1,
"Locale '%s' with codeset %d loaded by %s " "not found on %s",
7628 snprintf (err_msg,
sizeof (err_msg) - 1,
7629 "Locale '%s' with codeset %d has changed : " "on %s, checksum is '%s'; on %s, checksum is '%s'",
7639 while (lld !=
NULL);
7643 for (j = 0; j < loc_cnt; j++)
7645 bool loc_found =
false;
7649 ref_loc = &(loc_array[j]);
7651 for (i = 0; i < lang_Count_locales && !loc_found; i++)
7653 lld = lang_Loaded_locales[
i];
7664 while (lld !=
NULL);
7669 snprintf (err_msg,
sizeof (err_msg) - 1,
"Locale '%s' with codeset %d defined on %s " "is not loaded by %s",
7680 snprintf (err_msg,
sizeof (err_msg) - 1,
7681 "Locale '%s' with codeset %d has changed : " "on %s, checksum is '%s'; on %s, checksum is '%s'",
int lang_set_charset(const INTL_CODESET codeset)
void(* init_coll)(LANG_COLLATION *lang_coll)
const char * month_short_parse_order
static unsigned int lang_Weight_EN_ci[LANG_CHAR_COUNT_EN]
static TEXT_CONVERSION * console_Conv
#define LANG_MAX_COLLATIONS
#define INTL_IS_NEXT_CONTR(v)
static void lang_free_collations(void)
const char * charset_cubrid_name
const char * month_name[CAL_MONTH_COUNT]
int lang_set_language(const char *lang_str)
int(* split_key)(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
static bool lang_Builtin_initialized
static bool lang_Parser_use_client_charset
const char * lang_currency_symbol(DB_CURRENCY curr)
#define LANG_SYS_COLLATION
static int lang_back_strmatch_utf8_uca_w_level(const COLL_DATA *coll_data, bool is_match, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char *escape, const bool has_last_escape, int *offset_next_level, int *str1_match_size, bool ignore_trailing_space)
CONV_CP_TO_BYTES * utf8_to_text
static unsigned int lang_Weight_EN_cs_ti[LANG_CHAR_COUNT_EN]
int lang_db_put_charset(void)
const char * lang_get_msg_Loc_name(void)
int lang_locale_data_load_from_lib(LANG_LOCALE_DATA *lld, void *lib_handle, const LOCALE_FILE *lf, bool is_load_for_dump)
#define LANG_NO_NORMALIZATION
char lang_name[LANG_MAX_LANGNAME]
static int lang_strmatch_utf8_w_contr(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, int size1, const unsigned char *str2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
int intl_toupper_iso8859(unsigned char *s, int length)
#define LANG_COLL_GENERIC_SORT_OPT
static LANG_LOCALE_DATA * lang_Loaded_locales[LANG_MAX_LOADED_LOCALES]
static LANG_COLLATION coll_Utf8_ko_cs
int lang_load_coll_from_lib(COLL_DATA *cd, void *lib_handle, const LOCALE_FILE *lf)
bool lang_get_parser_use_client_charset(void)
static int lang_next_alpha_char_iso88591(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
#define SHLIB_GET_ADDR(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME)
static void lang_initloc_en_utf8(LANG_LOCALE_DATA *ld)
#define LOCALE_NULL_CALENDAR_NAMES
static bool lang_is_codeset_allowed(const INTL_LANG intl_id, const INTL_CODESET codeset)
static void lang_init_coll_Utf8_tr_cs(LANG_COLLATION *lang_coll)
bool lang_check_identifier(const char *name, int length)
static char lang_timestamptz_format_TR[]
int(* next_coll_seq)(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
int lang_get_lang_id_from_name(const char *lang_name, INTL_LANG *lang_id)
void(* init_conv_func)(void)
#define LANG_VARIABLE_CHARSET(x)
static void ** loclib_Handle
static unsigned int lang_upper_i_TR[LANG_CHAR_COUNT_TR]
int intl_text_single_byte_to_utf8(const char *in_buf, const int in_size, char **out_buf, int *out_size)
int lang_charset_name_to_id(const char *name, INTL_CODESET *codeset)
static int lang_strmatch_binary(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, int size1, const unsigned char *str2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
static int lang_next_coll_byte(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
COLL_MATCH_CONTR sett_match_contr
int lang_locales_count(bool check_codeset)
int lang_load_library(const char *lib_file, void **handle)
#define DEFAULT_COLL_OPTIONS
static int lang_split_key_byte(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
int lang_check_locale_compat(const LANG_LOCALE_COMPAT *loc_array, const int loc_cnt, const char *client_text, const char *server_text)
static int lang_strmatch_utf8_uca_w_level(const COLL_DATA *coll_data, const int level, bool is_match, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char *escape, const bool has_last_escape, int *offset_next_level, int *str1_match_size, bool ignore_trailing_space)
#define LANG_CHARSET_ISO88591_ALIAS2
static int lang_fastcmp_ko(const LANG_COLLATION *lang_coll, const unsigned char *string1, int size1, const unsigned char *string2, int size2, bool ignore_trailing_space)
static void free_lang_locale_data(LANG_LOCALE_DATA *lld)
const char * lang_date_format_parse(const INTL_LANG lang_id, const INTL_CODESET codeset, const DB_TYPE type, INTL_CODESET *format_codeset)
static int lang_split_key_euckr(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
UCA_L13_W uca_w_l13[MAX_UCA_EXP_CE]
int(* text_to_utf8_func)(const char *, const int, char **, int *)
#define assert_release(e)
const char * am_pm[CAL_AM_PM_COUNT]
static int check_env_lang_val(char *env_val, char *lang_name, char **charset_ptr, INTL_CODESET *codeset)
INTL_LANG lang_get_lang_id_from_flag(const int flag, bool *has_user_format, bool *has_user_lang)
#define ADD_TO_HASH(pseudo_key, w)
static UNICODE_NORMALIZATION * generic_Unicode_norm
static LANG_COLLATION coll_Iso_binary
#define LANG_COLL_NO_CONTR
static char lang_datetimetz_format_TR[]
const char * month_short_name[CAL_MONTH_COUNT]
static bool lang_Charset_initialized
unsigned int * weights_ti
static int set_current_locale(void)
static LANG_LOCALE_DATA lc_Turkish_iso88591
static int lang_fastcmp_binary(const LANG_COLLATION *lang_coll, const unsigned char *string1, const int size1, const unsigned char *string2, const int size2, bool ignore_trailing_space)
char lang_digit_fractional_symbol(const INTL_LANG lang_id)
static bool lang_Initialized
static int lang_strmatch_utf8_uca(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
const char * datetime_format
static int loclib_Handle_count
int intl_cp_to_utf8(const unsigned int codepoint, unsigned char *utf8_seq)
const unsigned char * intl_nextchar_euc(const unsigned char *s, int *curr_char_length)
#define LANG_CHARSET_EUCKR_ALIAS1
static unsigned int lang_lower_TR[LANG_CHAR_COUNT_TR]
#define LOC_LIB_SYMBOL_NAME_SIZE
static void set_default_lang(void)
void db_date_locale_init(void)
#define GET_UCA_WEIGHT(l, i, l13w, l4w)
const char * timestamptz_format
static int init_user_locales(void)
LANG_LOCALE_DATA * next_lld
static int lang_strmatch_ko(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, int size1, const unsigned char *str2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
static unsigned int lang_Weight_EN_cs[LANG_CHAR_COUNT_EN]
const LANG_LOCALE_DATA * lang_locale(void)
static unsigned int lang_mht2str_byte(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
#define LOCALE_NULL_DATE_FORMATS
INTL_CODESET lang_Loc_charset
static INTL_LANG lang_Lang_id
static unsigned int lang_mht2str_ko(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
const char * lang_get_collation_name(const int coll_id)
void lang_init_builtin(void)
static int lang_split_key_iso(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
const char * charset_name
int db_make_string(DB_VALUE *value, DB_CONST_C_CHAR str)
#define LANG_NAME_DEFAULT
unsigned int intl_back_utf8_to_cp(const unsigned char *utf8_start, const unsigned char *utf8_last, unsigned char **last_byte__prev_char)
INTL_CODESET lang_charset(void)
const LANG_LOCALE_DATA * lang_get_first_locale_for_lang(const INTL_LANG lang)
LANG_COLLATION * lang_Collations[LANG_MAX_COLLATIONS]
static int lang_str_utf8_trail_zero_weights(const LANG_COLLATION *lang_coll, const unsigned char *str, int size)
static UCA_L4_W uca_l4_max_weight
UNICODE_MAPPING * unicode_mappings
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
static bool lang_Language_initialized
static unsigned int lang_Next_alpha_char_EN_ci[LANG_CHAR_COUNT_EN]
LANG_COLLATION * lang_get_collation(const int coll_id)
CONV_CP_TO_BYTES * text_to_utf8
static unsigned int lang_Next_alpha_char_TR_ti[LANG_CHAR_COUNT_TR]
static LANG_COLLATION coll_Iso88591_en_ci
static LANG_COLLATION * built_In_collations[]
int intl_text_utf8_to_dbcs(const char *in_buf, const int in_size, char **out_buf, int *out_size)
ALPHABET_DATA ident_alphabet
int intl_text_utf8_to_single_byte(const char *in_buf, const int in_size, char **out_buf, int *out_size)
static int lang_w_map_EN[LANG_W_MAP_COUNT_EN]
int lang_strmatch_utf8_uca_w_coll_data(const COLL_DATA *coll_data, bool is_match, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
char lang_digit_grouping_symbol(const INTL_LANG lang_id)
static int lang_strcmp_utf8_uca(const LANG_COLLATION *lang_coll, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, bool ignore_trailing_space)
static void lang_init_common_en_cs(COLL_DATA *coll_data)
unsigned int text_first_cp
#define ER_OUT_OF_VIRTUAL_MEMORY
#define INTL_CONTR_FOUND(v)
static int lang_split_key_binary(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
static void lang_initloc_tr_iso(LANG_LOCALE_DATA *ld)
LANG_COLLATION * lang_get_collation_by_name(const char *coll_name)
#define LOCALE_DUMMY_ALPHABET(codeset)
void lang_set_parser_use_client_charset(bool use)
#define LANG_MAX_LOADED_LOCALES
#define LANG_MAX_BUILTIN_COLLATIONS
static unsigned int lang_mht2str_utf8(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
static LANG_LOCALE_DATA * find_lang_locale_data(const char *name, const INTL_CODESET codeset, LANG_LOCALE_DATA **last_lang_locale)
const char * timestamp_format
const char * day_parse_order
static unsigned int lang_Next_alpha_char_TR[LANG_CHAR_COUNT_TR]
static LANG_COLLATION coll_Euckr_bin
INTL_CODESET lang_charset_cubrid_name_to_id(const char *name)
UCA_L4_W uca_w_l4[MAX_UCA_EXP_CE]
static LANG_COLLATION coll_Iso88591_en_cs
#define LANG_CHARSET_EUCKR
unsigned int utf8_first_cp
#define SHLIB_GET_VAL(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME)
static LANG_COLLATION coll_Utf8_binary
const char * day_short_parse_order
int * unicode_mapping_index
const char * am_pm_parse_order
int locale_get_cfg_locales(LOCALE_FILE **p_locale_files, int *p_num_locales, bool is_lang_init)
int lang_collation_count(void)
#define LANG_CHARSET_UTF8_ALIAS1
static LANG_COLLATION coll_Utf8_en_ci
static void lang_initloc_tr_utf8(LANG_LOCALE_DATA *ld)
unsigned int cp_first_contr_count
TEXT_CONVERSION con_Iso_8859_9_conv
static int lang_locale_load_normalization_from_lib(UNICODE_NORMALIZATION *norm, void *lib_handle, const LOCALE_FILE *lf)
UNICODE_NORMALIZATION * lang_get_generic_unicode_norm(void)
static void lang_init_coll_en_ci(LANG_COLLATION *lang_coll)
#define strncpy_bufsize(buf, str)
static char lang_date_format_TR[]
unsigned int intl_utf8_to_cp(const unsigned char *utf8, const int size, unsigned char **next_char)
static int lang_Count_locales
void lang_init_console_txt_conv(void)
static int register_lang_locale_data(LANG_LOCALE_DATA *lld)
static LANG_COLLATION coll_Utf8_en_cs
#define LANG_CHARSET_UTF8
const char * day_name[CAL_DAY_COUNT]
static LANG_LOCALE_DATA lc_Turkish_utf8
static unsigned int lang_Next_alpha_char_EN_cs[LANG_CHAR_COUNT_EN]
static int lang_fastcmp_byte(const LANG_COLLATION *lang_coll, const unsigned char *string1, const int size1, const unsigned char *string2, const int size2, bool ignore_trailing_space)
int * cp_first_contr_array
unsigned int utf8_last_cp
static int lang_next_coll_seq_utf8_w_contr(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
static int lang_next_coll_char_utf8(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
static unsigned int lang_Weight_EN_ci_ti[LANG_CHAR_COUNT_EN]
static int lang_str_utf8_trail_zero_weights_w_exp(const COLL_DATA *coll_data, const int level, const unsigned char *str, int size)
int intl_char_size(const unsigned char *src, int length_in_chars, INTL_CODESET src_codeset, int *byte_count)
static void lang_initloc_ko_utf8(LANG_LOCALE_DATA *ld)
static int lang_strcmp_utf8_w_contr(const LANG_COLLATION *lang_coll, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, bool ignore_trailing_space)
int db_put_internal(DB_OBJECT *obj, const char *name, DB_VALUE *value)
static void lang_initloc_ko_iso(LANG_LOCALE_DATA *ld)
const char * month_parse_order
static int set_msg_lang_from_env(void)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int pr_clear_value(DB_VALUE *value)
const LANG_LOCALE_DATA * lang_get_specific_locale(const INTL_LANG lang, const INTL_CODESET codeset)
static LANG_LOCALE_DATA lc_English_utf8
#define UNICODE_NORMALIZATION_DECORATOR
DB_CURRENCY lang_currency()
static char lang_datetime_format_TR[]
#define LANG_CHAR_COUNT_EN
const char * lang_charset_cubrid_name(const INTL_CODESET codeset)
void(* initloc)(LANG_LOCALE_DATA *ld)
char c_buf[LOC_MAX_UCA_CHARS_SEQ *INTL_UTF8_MAX_CHAR_SIZE]
static void destroy_user_locales(void)
UNICODE_NORMALIZATION unicode_norm
void tp_apply_sys_charset(void)
static unsigned int lang_upper_EN[LANG_CHAR_COUNT_EN]
const char * envvar_get(const char *name)
static UCA_L13_W uca_l13_max_weight
static COLL_CONTRACTION * lang_get_contr_for_string(const COLL_DATA *coll_data, const unsigned char *str, const int str_size, unsigned int cp)
static unsigned int lang_Weight_TR_ti[LANG_CHAR_COUNT_TR]
static void error(const char *msg)
int lang_set_charset_lang(const char *lang_charset)
static int lang_split_key_utf8(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
static LANG_LOCALE_DATA lc_Korean_iso88591
unsigned char byte_flag[256]
static unsigned int lang_lower_i_TR[LANG_CHAR_COUNT_TR]
#define LANG_CHARSET_ISO88591
static int lang_locale_load_alpha_from_lib(ALPHABET_DATA *a, bool load_w_identifier_name, const char *alpha_suffix, void *lib_handle, const LOCALE_FILE *lf)
static DB_CURRENCY lang_Loc_currency
static int lang_next_alpha_char_ko(const LANG_COLLATION *lang_coll, const unsigned char *seq, const int size, unsigned char *next_seq, int *len_next, bool ignore_trailing_space)
static LANG_COLLATION coll_Binary
static LANG_COLLATION coll_Utf8_tr_cs
static unsigned int lang_Next_alpha_char_EN_cs_ti[LANG_CHAR_COUNT_EN]
static int lang_get_builtin_lang_id_from_name(const char *lang_name, INTL_LANG *lang_id)
static int loclib_Handle_size
static char lang_timestamp_format_TR[]
COLL_CONTRACTION * contr_list
int lang_get_charset_env_string(char *buf, int buf_size, const char *lang_name, const INTL_CODESET codeset)
int(* strmatch)(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *string1, int size1, const unsigned char *string2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
static int register_collation(LANG_COLLATION *coll)
#define snprintf_dots_truncate(dest, max_len,...)
const char * lang_get_codeset_name(int codeset_id)
static void lang_initloc_ko_euc(LANG_LOCALE_DATA *ld)
static LANG_LOCALE_DATA lc_Korean_utf8
TEXT_CONVERSION * txt_conv
static LANG_LOCALE_DATA * lang_Loc_data
static int lang_strmatch_utf8(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, int size1, const unsigned char *str2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
void init_builtin_calendar_names(LANG_LOCALE_DATA *lld)
#define LANG_NAME_ENGLISH
static char lang_Lang_name[LANG_MAX_LANGNAME]
#define free_and_init(ptr)
static unsigned int lang_get_w_first_el(const COLL_DATA *coll, const unsigned char *str, const int str_size, unsigned char **next_char, bool ignore_trailing_space)
LANG_COLLATION * default_lang_coll
unsigned int(* mht2str)(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
char * prm_get_string_value(PARAM_ID prm_id)
TEXT_CONVERSION con_Iso_8859_1_conv
LANG_LOCALE_DATA * default_lang
#define LANG_CHARSET_ISO88591_ALIAS1
const char * lang_get_lang_name_from_id(const INTL_LANG lang_id)
char * intl_get_money_symbol_console(const DB_CURRENCY currency)
static LANG_LOCALE_DATA lc_Korean_euckr
enum intl_codeset INTL_CODESET
int lang_set_flag_from_lang(const char *lang_str, bool has_user_format, bool has_user_lang, int *flag)
const ALPHABET_DATA * lang_user_alphabet_w_coll(const int collation_id)
static const DB_CHARSET lang_Db_charsets[]
int unicode_mappings_count
int lang_set_flag_from_lang_id(const INTL_LANG lang, bool has_user_format, bool has_user_lang, int *flag)
static int lang_strmatch_byte(const LANG_COLLATION *lang_coll, bool is_match, const unsigned char *str1, int size1, const unsigned char *str2, int size2, const unsigned char *escape, const bool has_last_escape, int *str1_match_size, bool ignore_trailing_space)
static void lang_get_uca_w_l13(const COLL_DATA *coll_data, const bool use_contractions, const unsigned char *str, const int size, UCA_L13_W **uca_w_l13, int *num_ce, unsigned char **str_next, unsigned int *cp_out)
const char * datetimetz_format
int intl_cmp_char(const unsigned char *s1, const unsigned char *s2, INTL_CODESET codeset, int *char_size)
static void lang_get_uca_w_l4(const COLL_DATA *coll_data, const bool use_contractions, const unsigned char *str, const int size, UCA_L4_W **uca_w_l4, int *num_ce, unsigned char **str_next, unsigned int *cp_out)
static unsigned int lang_Weight_TR[LANG_CHAR_COUNT_TR]
static int lang_split_key_w_exp(const LANG_COLLATION *lang_coll, const bool is_desc, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, const unsigned char **key, int *byte_size, bool ignore_trailing_space)
#define LOG_LOCALE_ERROR(msg, er_status, do_print)
static char lang_time_format_TR[]
static bool lang_Init_w_error
static char lang_Loc_name[LANG_MAX_LANGNAME]
unsigned short int UCA_L4_W
INTL_CODESET lang_get_client_charset(void)
static void lang_get_uca_back_weight_l13(const COLL_DATA *coll_data, const bool use_contractions, const unsigned char *str_start, const unsigned char *str_last, UCA_L13_W **uca_w_l13, int *num_ce, unsigned char **str_prev, unsigned int *cp_out)
#define LANG_W_MAP_COUNT_EN
const INTL_CODESET codeset
static unsigned int lang_upper_TR[LANG_CHAR_COUNT_TR]
#define LANG_NAME_TURKISH
int intl_text_dbcs_to_utf8(const char *in_buf, const int in_size, char **out_buf, int *out_size)
const char * lang_charset_introducer(const INTL_CODESET codeset)
char coll_name[COLL_NAME_SIZE]
static INTL_CODESET lang_get_default_codeset(const INTL_LANG intl_id)
int(* utf8_to_text_func)(const char *, const int, char **, int *)
static void lang_init_coll_en_cs(LANG_COLLATION *lang_coll)
unsigned int mht_2str_pseudo_key(const void *key, int key_size)
int db_make_int(DB_VALUE *value, const int num)
static LANG_LOCALE_DATA lc_English_binary
static unsigned int lang_mht2str_utf8_exp(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
int(* fastcmp)(const LANG_COLLATION *lang_coll, const unsigned char *string1, const int size1, const unsigned char *string2, const int size2, bool ignore_trailing_space)
static bool lang_Msg_env_initialized
static void lang_initloc_en_binary(LANG_LOCALE_DATA *ld)
TEXT_CONVERSION * lang_get_txt_conv(void)
int lang_check_coll_compat(const LANG_COLL_COMPAT *coll_array, const int coll_cnt, const char *client_text, const char *server_text)
void lang_set_generic_unicode_norm(UNICODE_NORMALIZATION *norm)
int lang_load_count_coll_from_lib(int *count_coll, void *lib_handle, const LOCALE_FILE *lf)
unsigned int text_last_cp
int intl_tolower_iso8859(unsigned char *s, int length)
#define LANG_MAX_LANGNAME
static void lang_unload_libraries(void)
unsigned int * next_cp_ti
const char * lang_charset_name(const INTL_CODESET codeset)
DB_CURRENCY lang_locale_currency(const char *locale_str)
DB_CURRENCY default_currency_code
static unsigned int lang_mht2str_default(const LANG_COLLATION *lang_coll, const unsigned char *str, const int size)
static int lang_Count_collations
#define INTL_GET_NEXT_CONTR_ID(v)
const char * lang_get_Lang_name(void)
static int lang_strcmp_utf8(const LANG_COLLATION *lang_coll, const unsigned char *str1, const int size1, const unsigned char *str2, const int size2, bool ignore_trailing_space)
static char lang_Msg_loc_name[LANG_MAX_LANGNAME]
static void lang_initloc_en_iso88591(LANG_LOCALE_DATA *ld)
static unsigned int lang_lower_EN[LANG_CHAR_COUNT_EN]
char coll_name[COLL_NAME_SIZE]
bool lang_is_coll_name_allowed(const char *name)
void envvar_trim_char(char *env_val, const int c)
static LANG_LOCALE_DATA lc_English_iso88591
int locale_check_and_set_default_files(LOCALE_FILE *lf, bool is_lang_init)
LANG_DEFAULTS builtin_Langs[]
#define SHLIB_GET_ADDR_W_REF(v, SYM_NAME, SYM_TYPE, lh, LOC_NAME)
static unsigned int lang_Next_alpha_char_EN_ci_ti[LANG_CHAR_COUNT_EN]
int lang_get_client_collation(void)
unsigned int cp_first_contr_offset
const char * day_short_name[CAL_DAY_COUNT]
const unsigned char *const intl_Len_utf8_char
#define LANG_CHAR_COUNT_TR
static void lang_init_common_en_ci(COLL_DATA *coll_data)
int lang_load_get_coll_name_from_lib(const int coll_pos, char **coll_name, void *lib_handle, const LOCALE_FILE *lf)