35 #if defined (SUPPRESS_STRLEN_WARNING) 36 #define strlen(s1) ((int) strlen(s1)) 39 #define DUCET_FILE "ducet.txt" 41 #define MAX_WEIGHT_LEVELS 4 43 #define MAX_UCA_WEIGHT 0xFFFF 44 #define MAX_UCA_CODEPOINT 0xFFFF 46 #define UCA_CONTR_EXP_CNT_GROW 8 48 #define MAX_LOGICAL_POS 14 64 #define GET_UCA_WEIGHT(ce_list,i,w) ((ce_list)->ce[(i)].weight[(w)]) 65 #define SET_UCA_WEIGHT(ce_list,i,w,val) \ 67 (ce_list)->ce[(i)].weight[(w)] = (val); \ 136 char prev_file_path[PATH_MAX];
163 static int load_ducet (
const char *file_path,
const int sett_contr_policy);
177 bool use_expansions);
191 static int compact_weight_values (
const int level,
const UCA_W max_weight);
192 static void build_weight_remap_filter (
const UCA_W * w_ocurr,
const int max_weight,
UCA_W * w_filter);
224 load_ducet (
const char *file_path,
const int sett_contr_policy)
252 if (temp_ducet ==
NULL)
259 ducet_cp = ducet.
coll_cp = temp_ducet;
290 while (fgets (str,
sizeof (str), f))
296 bool is_variable =
false;
297 char is_ignorable[4] = { -1, -1, -1, -1 };
301 int cp_list_count = 0;
302 bool is_allowed =
true;
307 strcpy (str_ref, str);
308 strcpy (str_orig, str);
310 cp = (
unsigned int) val;
318 if ((comment = strchr (str,
'#')))
322 for (; *comment ==
' '; comment++);
330 if ((weight = strchr (str,
';')))
334 for (; *weight ==
' '; weight++);
346 cp_int_list[cp_list_count++] = cp;
357 cp_list_count = codenum;
359 for (i = 0; i < codenum; i++)
367 cp_list[
i] = (
UCA_CP) cp_int_list[i];
396 memcpy (contr->
cp_list, cp_list, cp_list_count * sizeof (
UCA_CP));
398 ce_list = &(contr->
ce);
402 ce_list = &(ducet_cp[cp]);
408 s = strtok_r (weight,
" []", &save);
412 weights[ce_list->
num] = s;
413 s = strtok_r (
NULL,
" []", &save);
417 for (w = 0; w < ce_list->
num; w++)
424 is_variable = ((*s) ==
'*') ?
true :
false;
438 if (val == 0 && is_ignorable[partnum] == -1)
440 is_ignorable[partnum] = 1;
444 is_ignorable[partnum] = 0;
461 assert (is_ignorable[0] == 0 || is_ignorable[0] == 1);
462 assert (is_ignorable[1] == 0 || is_ignorable[1] == 1);
463 assert (is_ignorable[2] == 0 || is_ignorable[2] == 1);
465 if (is_ignorable[0] == 1)
474 if (is_ignorable[1] == 1)
483 if (is_ignorable[2] == 1)
492 if (is_ignorable[0] == 0 && is_ignorable[1] == 0 && is_ignorable[2] == 0)
508 unsigned int base, aaaa, bbbb;
511 if (ducet_cp[cp].num)
520 if (cp >= 0x3400 && cp <= 0x4DB5)
524 else if (cp >= 0x4E00 && cp <= 0x9FA5)
533 aaaa = base + (cp >> 15);
534 bbbb = (cp & 0x7FFF) | 0x8000;
547 ducet_cp[cp].
num = 2;
575 char ducet_file_path[PATH_MAX];
606 for (j = 0; j < ducet_contr->
cp_count; j++)
619 if (uca_contr ==
NULL)
645 if (weight_key_list ==
NULL)
701 if (weight_key_list !=
NULL)
705 if (weight_key_list[i].key_list !=
NULL)
707 free (weight_key_list[i].key_list);
711 free (weight_key_list);
712 weight_key_list =
NULL;
731 int result,
i, weight_level;
732 int numCodepoints = 0;
738 numCodepoints = MIN (ce_list1->
num, ce_list2->
num);
740 if (numCodepoints == 0)
743 if (ce_list1->
num > 0)
747 else if (ce_list2->
num > 0)
756 numCodepoints = MAX (ce_list1->
num, ce_list2->
num);
760 numCodepoints = MIN (numCodepoints, 1);
763 for (weight_level = 0; (weight_level <
MAX_WEIGHT_LEVELS) && (result == 0); weight_level++)
772 for (i = 0; (i < numCodepoints) && (result == 0); i++)
816 printf (
"Initializing UCA\n");
827 printf (
"DUCET file has %d contractions\n", ducet.
count_contr);
840 printf (
"Build weight statistics\n");
869 printf (
"Building optimized weights with expansions\n");
882 printf (
"Sorting weight keys lists\n");
888 printf (
"Building optimized weights\n");
901 uca_tailoring_options =
NULL;
904 printf (
"UCA finished\n");
925 unsigned char *ptr_uchar;
934 int anchor_cp_count = 0;
935 int ref_cp_count = 0;
956 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid anchor in rule :%d. Codepoint value too big", i);
968 ptr_uchar = (
unsigned char *) t_rule->
anchor_buf;
973 if (cp_found <= 0 || cp_found > anchor_cp_count)
976 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid anchor in rule :%d", i);
981 if (anchor_cp_count == 1)
983 assert (*anchor_cp_list > 0);
988 assert (anchor_cp_count > 1);
997 contr_id =
find_contr_id (anchor_cp_list, anchor_cp_count, &curr_uca);
1015 exp_id =
find_exp_id (anchor_cp_list, anchor_cp_count, &curr_uca);
1025 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid anchor in rule :%d." "Cannot create expansion",
1038 ptr_uchar = (
unsigned char *) t_rule->
r_buf;
1041 if (cp_found <= 0 || cp_found > ref_cp_count)
1044 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid reference in rule :%d", i);
1049 if (ref_cp_count == 1)
1054 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid reference in rule :%d." " Codepoint value too big",
1060 assert (*ref_cp_list > 0);
1065 assert (ref_cp_count > 1);
1074 contr_id =
find_contr_id (ref_cp_list, ref_cp_count, &curr_uca);
1092 exp_id =
find_exp_id (ref_cp_list, ref_cp_count, &curr_uca);
1101 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid reference in rule: %d" "Cannot create expansion",
1114 unsigned char *tailor_curr;
1115 unsigned char *tailor_next;
1116 unsigned char *tailor_end;
1118 tailor_curr = (
unsigned char *) (t_rule->
t_buf);
1119 tailor_next = tailor_curr;
1120 tailor_end = tailor_curr + t_rule->
t_buf_size;
1122 while (tailor_next < tailor_end)
1124 unsigned int tailor_cp =
1131 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid tailoring in rule :%d." "Codepoint : %4X too big", i,
1144 snprintf (er_msg,
sizeof (er_msg) - 1,
"Cannot apply :%d", i);
1149 tailor_curr = tailor_next;
1157 int tailor_cp_count;
1160 ptr_uchar = (
unsigned char *) t_rule->
t_buf;
1164 if (cp_found <= 0 || cp_found > tailor_cp_count)
1167 snprintf (er_msg,
sizeof (er_msg) - 1,
1168 "Invalid tailoring in rule :%d." "Invalid number of codepoints: %d", i, cp_found);
1173 if (tailor_cp_count > 1)
1181 contr_id =
find_contr_id (tailor_cp_list, tailor_cp_count, &curr_uca);
1191 snprintf (er_msg,
sizeof (er_msg) - 1,
"Rule :%d. Cannot create contraction.", i);
1203 snprintf (er_msg,
sizeof (er_msg) - 1,
"Invalid tailoring in rule :%d." " Codepoint value too big",
1209 assert (*tailor_cp_list > 0);
1216 snprintf (er_msg,
sizeof (er_msg) - 1,
"Rule :%d", i);
1236 int depth, weight_level;
1245 for (depth = 0; depth < uca_cp[cp].
num; depth++)
1259 for (depth = 0; depth < contr->
ce.
num; depth++)
1272 used_weights[weight_level] = 0;
1273 max_weight_val[weight_level] = 0;
1278 used_weights[weight_level]++;
1279 max_weight_val[weight_level] =
i;
1284 if (max_weight_val[1] > 0x1ff || max_weight_val[2] > 0x7f + 1)
1307 compact_weight_values (
const int level,
const UCA_W max_weight)
1314 assert (level >= 0 && level <= 3);
1316 w_filter = (
UCA_W *) malloc ((max_weight + 1) *
sizeof (
UCA_W));
1317 if (w_filter ==
NULL)
1324 memset (w_filter, 0xffff, (max_weight + 1) *
sizeof (
UCA_W));
1326 build_weight_remap_filter (
w_occurences[level], max_weight, w_filter);
1333 for (depth = 0; depth < uca_cp[cp].
num; depth++)
1349 for (depth = 0; depth < contr->
ce.
num; depth++)
1362 if (w_filter !=
NULL)
1382 build_weight_remap_filter (
const UCA_W * w_ocurr,
const int max_weight,
UCA_W * w_filter)
1387 assert (max_weight > 0 && max_weight <= 0xffff);
1392 for (w = 0; w <= max_weight; w++)
1396 w_filter[w] = last_used_w++;
1400 assert (last_used_w < max_weight);
1427 if (weight_key_list[wv].key_list ==
NULL)
1488 if (weight_key_list[weight_index].list_count <= 0)
1493 qsort (weight_key_list[weight_index].key_list, weight_key_list[weight_index].list_count,
sizeof (
UCA_COLL_KEY),
1523 if (pos1_key->
type == pos2_key->
type)
1623 int equal_key_count,
i;
1624 unsigned int current_weight;
1635 if (equal_key_list ==
NULL)
1664 for (weight_index = 0; weight_index <=
MAX_UCA_WEIGHT; weight_index++)
1668 for (key_cursor = 0; key_cursor < weight_key_list[weight_index].
list_count; key_cursor++)
1674 if (curr_ce_list ==
NULL)
1703 prev_key = curr_key;
1704 prev_ce_list = curr_ce_list;
1709 equal_key_count = 0;
1710 for (weight_index = 0; weight_index <=
MAX_UCA_WEIGHT; weight_index++)
1714 for (key_cursor = 0; key_cursor < weight_key_list[weight_index].
list_count; key_cursor++)
1720 if (curr_ce_list ==
NULL)
1731 for (i = 0; i < equal_key_count; i++)
1736 equal_key_count = 0;
1739 memcpy (&(equal_key_list[equal_key_count++]), curr_key,
sizeof (
UCA_COLL_KEY));
1741 prev_key = curr_key;
1742 prev_ce_list = curr_ce_list;
1749 for (i = 0; i < equal_key_count; i++)
1773 if (equal_key_list !=
NULL)
1775 free (equal_key_list);
1776 equal_key_list =
NULL;
1802 if (initial_coll_tag ==
NULL)
1833 assert (curr_idx < lc->opt_coll.count_contr);
1838 if (initial_coll_tag[opt_idx].pos_id == curr_idx)
1872 assert (curr_idx < lc->opt_coll.count_contr);
1877 if (initial_coll_tag[opt_idx].pos_id == curr_idx)
1921 unsigned char *dummy;
1922 int c_buf_size =
strlen ((
char *) c_buf);
1973 if (initial_coll_tag !=
NULL)
1975 free (initial_coll_tag);
1976 initial_coll_tag =
NULL;
2039 bool use_expansions)
2066 p_buf = opt_contr->
c_buf;
2070 for (i = 0; i < uca_contr->
cp_count; i++)
2073 (
unsigned char *) p_buf);
2081 opt_contr->
size = (
unsigned char) (p_buf - opt_contr->
c_buf);
2182 UCA_W current_weight;
2193 if (ce_list_key ==
NULL || ce_list_ref_key ==
NULL)
2213 assert (ce_list_key != ce_list_ref_key);
2241 bool collation_finished, overflow =
false;
2242 UCA_W current_weight;
2256 if (ce_list_key ==
NULL || ce_list_ref_key ==
NULL || ce_list_anchor_key ==
NULL)
2270 new_ce.
num = MAX (new_ce.
num, ce_list_ref_key->
num);
2273 for (j = 0; j < (int) lvl; j++)
2275 for (i = 0; i < (int) (new_ce.
num); i++)
2281 collation_finished =
false;
2283 while (!collation_finished)
2324 int ce_index = (int) (new_ce.
num);
2326 while (ce_index > 0 &&
GET_UCA_WEIGHT (&new_ce, ce_index - 1, lvl - 1) == 0)
2370 collation_finished =
true;
2404 int i, ce_index, level_index;
2411 if (weight_key_list[weight_index].list_count == 0)
2416 for (i = 0; i < weight_key_list[weight_index].
list_count; i++)
2421 if (ce_list ==
NULL)
2427 for (level_index = 0; level_index < lvl && found; level_index++)
2429 for (ce_index = 0; ce_index < uca_item->
num; ce_index++)
2467 key->
val.
cp = key_id;
2519 for (j = 0; j < cp_count; j++)
2523 if (cp_array[j] != (
unsigned int) (st_cp_list[j]))
2575 for (j = 0; j < cp_count; j++)
2579 if (cp_array[j] != (
unsigned int) (st_cp_list[j]))
2606 int weight_index, ce_index, state;
2620 error_found =
false;
2621 while (
strlen (str) > 0 && !error_found)
2652 weight = (
UCA_W) val;
2655 if (weight_index != 3)
2694 uca_item.
num = ce_index;
2731 int rule_index, weight_index;
2750 strcpy (ct_rule->
step,
"[0001.0000.0000.0000]\0");
2778 is_overflow =
false;
2781 for (ce_index = 0; ce_index < step.
num; ce_index++)
2805 for (cp_index = start_cp; cp_index <= end_cp; cp_index++)
2810 for (ce_index = 0; ce_index < weight_offset.
num; ce_index++)
2822 if (
GET_UCA_WEIGHT (&(uca_cp[cp_index]), uca_cp[cp_index].num - 1, weight_index) != 0)
2824 is_ce_empty =
false;
2827 if (is_ce_empty && uca_cp[cp_index].num > 1)
2829 uca_cp[cp_index].
num--;
2831 if (uca_cp[cp_index].num == 1)
2859 if ((weight_key_list[wv].key_list =
2860 (
UCA_COLL_KEY *) realloc (weight_key_list[wv].key_list,
2867 memcpy (&(weight_key_list[wv].key_list[weight_key_list[wv].list_count]), key,
sizeof (
UCA_COLL_KEY));
2889 if (weight_key_list[wv].list_count == 0)
2893 else if (weight_key_list[wv].list_count == 1)
2895 if (memcmp (&(weight_key_list[wv].key_list[0]), key,
sizeof (
UCA_COLL_KEY)) == 0)
2898 memset (&(weight_key_list[wv].key_list[0]), 0,
sizeof (
UCA_COLL_KEY));
2903 assert (weight_key_list[wv].list_count > 1);
2906 for (i = 0; i < weight_key_list[wv].
list_count; i++)
2908 if (memcmp (&(weight_key_list[wv].key_list[i]), key,
sizeof (
UCA_COLL_KEY)) == 0)
2917 for (i = found_at; i < weight_key_list[wv].
list_count - 1; i++)
2919 memcpy (&(weight_key_list[wv].key_list[i]), &(weight_key_list[wv].key_list[i + 1]),
sizeof (
UCA_COLL_KEY));
2926 memset (&(weight_key_list[wv].key_list[i]), 0,
sizeof (
UCA_COLL_KEY));
3073 if (uca_seq ==
NULL)
3079 for (i = 0; i < cp_count; i++)
3092 for (i = 0; i < cp_count; i++)
3102 if (cp_ce_list ==
NULL)
3117 for (ce_index = 0; ce_index < cp_ce_list->
num; ce_index++)
3125 ce_count += cp_ce_list->
num;
3128 uca_seq->
ce.
num = ce_count;
3168 unsigned char *dummy;
3174 if (*buffer ==
'\0')
3177 snprintf (err_msg,
sizeof (err_msg) - 1,
"Tag has no content");
3187 snprintf (err_msg,
sizeof (err_msg) - 1,
"Multiple chars found in codepoint tag." "Tag content: %s", buffer);
3195 if (temp_cp > 0xFFFF || temp_cp < 0)
3198 snprintf (err_msg,
sizeof (err_msg) - 1,
"Codepoint found in tag was out of range." "Tag content: %s",
3208 result =
str_to_int32 (&temp_cp, &chr_ptr, (
const char *) buffer, 16);
3209 if (result != 0 || temp_cp > 0xFFFF || temp_cp < 0)
3212 snprintf (err_msg,
sizeof (err_msg) - 1,
"Codepoint found in tag was out of range." "Tag content: %s",
3217 else if (temp_cp == 0 && (chr_ptr == (
char *) buffer))
3221 snprintf (err_msg,
sizeof (err_msg) - 1,
"No valid codepoint could be found in tag." "Tag content: %s",
3226 else if (temp_cp > 0 &&
strlen (chr_ptr) != 0)
3230 snprintf (err_msg,
sizeof (err_msg) - 1,
"Encountered codepoint tag with invalid content." "Tag content: %s",
3273 char *uca_exp_num =
NULL;
3274 int uca_w_array_size_l13;
3275 int uca_w_array_size_l4;
3280 unsigned int *coll_key_list =
NULL;
3281 int coll_key_list_cnt = 0;
3289 if (coll_key_list ==
NULL)
3301 max_num = MAX (max_num, ce_list->
num);
3308 uca_w_l13 = (
UCA_L13_W *) malloc (uca_w_array_size_l13);
3311 if (uca_w_l13 ==
NULL || uca_exp_num ==
NULL)
3318 memset (uca_w_l13, 0, uca_w_array_size_l13);
3324 uca_w_l4 = (
UCA_L4_W *) malloc (uca_w_array_size_l4);
3325 if (uca_w_l4 ==
NULL)
3332 memset (uca_w_l4, 0, uca_w_array_size_l4);
3356 uca_exp_num[cp] = ce_list->
num;
3358 assert (uca_exp_num[cp] > 0);
3366 coll_key_list[coll_key_list_cnt++] = cp;
3388 uca_tailoring_options = &uca_exp_next_opt;
3391 for (i = 0; i < coll_key_list_cnt - 1; i++)
3395 unsigned int curr_pos = coll_key_list[
i];
3396 unsigned int next_pos = 0;
3409 for (j = i + 1; j < coll_key_list_cnt; j++)
3411 next_pos = coll_key_list[j];
3431 uca_tailoring_options = saved_uca_opt;
3436 unsigned int curr_pos = coll_key_list[coll_key_list_cnt - 1];
3454 if (coll_key_list !=
NULL)
3456 free (coll_key_list);
3480 pos1 = *((
unsigned int *) arg1);
3481 pos2 = *((
unsigned int *) arg2);
3485 return (cmp == 0) ? (int) (pos1 - pos2) :
cmp;
3506 pos1 = *((
unsigned int *) arg1);
3507 pos2 = *((
unsigned int *) arg2);
3551 for (i = 0; i < ce_list->
num; i++)
3559 w_l123 |= w2 & 0x000001ff;
3562 w_l123 |= w1 & 0x0000ffff;
3564 uca_w_l13[
i] = w_l123;
3580 for (i = 0; i < ce_list->
num; i++)
static int find_exp_id(const unsigned int *cp_array, const int cp_count, UCA_STORAGE *st)
int uca_process_collation(LOCALE_COLLATION *lc, bool is_verbose)
#define INTL_IS_NEXT_CONTR(v)
#define MAX_UCA_CODEPOINT
static int apply_tailoring_rule_w_dir(TAILOR_DIR dir, UCA_COLL_KEY *anchor_key, UCA_COLL_KEY *key, UCA_COLL_KEY *ref_key, T_LEVEL lvl)
#define MAX_WEIGHT_LEVELS
static int load_ducet(const char *file_path, const int sett_contr_policy)
static int create_opt_weights(LOCALE_COLLATION *lc)
CP_BUF_TYPE start_cp_buf_type
char end_cp_buf[LOC_DATA_BUFF_SIZE]
static void sort_coll_key_lists(LOCALE_COLLATION *lc)
UCA_CP cp_list[LOC_MAX_UCA_CHARS_SEQ]
#define SET_UCA_WEIGHT(ce_list, i, w, val)
#define LOC_MAX_UCA_CHARS_SEQ
static int build_key_list_groups(LOCALE_COLLATION *lc)
union uca_coll_key::@37 val
static UCA_OPTIONS * uca_tailoring_options
static UCA_COLL_CE_LIST * get_ce_list_from_coll_key(const UCA_COLL_KEY *key)
UCA_L13_W uca_w_l13[MAX_UCA_EXP_CE]
char start_cp_buf[LOC_DATA_BUFF_SIZE]
static int apply_tailoring_rule(TAILOR_DIR dir, UCA_COLL_KEY *anchor_key, UCA_COLL_KEY *key, UCA_COLL_KEY *ref_key, T_LEVEL lvl)
static int remove_key_from_weight_stats_list(const UCA_COLL_KEY *key, UCA_W wv)
UCA_W weight[MAX_WEIGHT_LEVELS]
#define GET_UCA_WEIGHT(ce_list, i, w)
static UCA_STORAGE curr_uca
static int compare_ce_list(UCA_COLL_CE_LIST *ce_list1, UCA_COLL_CE_LIST *ce_list2, UCA_OPTIONS *uca_opt)
static int logical_pos_cp[MAX_LOGICAL_POS]
int intl_cp_to_utf8(const unsigned int codepoint, unsigned char *utf8_seq)
char prev_file_path[PATH_MAX]
int intl_count_utf8_chars(const unsigned char *s, int length_in_bytes)
static int compute_weights_per_level_stats(void)
UCA_CHR_SEQ UCA_EXPANSION
static int uca_comp_func_coll_list_exp_fo(const void *arg1, const void *arg2)
static void build_compressed_uca_w_l13(const UCA_COLL_CE_LIST *ce_list, UCA_L13_W *uca_w_l13)
static int change_key_weight_list(const UCA_COLL_KEY *key, UCA_W w_from, UCA_W w_to)
static UCA_EXPANSION * new_expansion(UCA_STORAGE *storage)
#define MAX_UNICODE_CHARS
static void build_uca_w_l4(const UCA_COLL_CE_LIST *ce_list, UCA_L4_W *uca_w_l4)
static int destroy_uca_instance(void)
char * envvar_localedatadir_file(char *path, size_t size, const char *filename)
struct uca_weight_key_list UCA_WEIGHT_KEY_LIST
static int create_opt_ce_w_exp(LOCALE_COLLATION *lc)
static UCA_CONTRACTION * new_contraction(UCA_STORAGE *storage)
#define ER_OUT_OF_VIRTUAL_MEMORY
static int apply_tailoring_rules(LOCALE_COLLATION *lc)
static int find_contr_id(const unsigned int *cp_array, const int cp_count, UCA_STORAGE *st)
UCA_L4_W uca_w_l4[MAX_UCA_EXP_CE]
static UCA_COLL_KEY * get_key_with_ce_sublist(UCA_COLL_CE_LIST *uca_item, const int lvl)
CUBRID_TAILOR_RULE * cub_rules
unsigned int cp_first_contr_count
struct coll_contraction COLL_CONTRACTION
int str_to_int32(int *ret_p, char **end_p, const char *str_p, int base)
unsigned int intl_utf8_to_cp(const unsigned char *utf8, const int size, unsigned char **next_char)
const char * er_msg(void)
static int init_uca_instance(LOCALE_COLLATION *lc)
CP_BUF_TYPE end_cp_buf_type
static UCA_WEIGHT_KEY_LIST * weight_key_list
int * cp_first_contr_array
char anchor_buf[LOC_DATA_COLL_TWO_CHARS]
static int apply_absolute_tailoring_rules(LOCALE_COLLATION *lc)
UCA_CHR_SEQ UCA_CONTRACTION
static int uca_comp_func_coll_list_exp(const void *arg1, const void *arg2)
char c_buf[LOC_MAX_UCA_CHARS_SEQ *INTL_UTF8_MAX_CHAR_SIZE]
FILE * fopen_ex(const char *filename, const char *type)
static void sort_one_coll_key_list(LOCALE_COLLATION *lc, int weight_index)
UCA_CONTRACTION * coll_contr
static int uca_comp_func_coll_key_fo(const void *arg1, const void *arg2)
#define INTL_UTF8_MAX_CHAR_SIZE
int string_to_int_array(char *s, uint32 *cp_list, const int cp_list_size, const char *delims)
int intl_utf8_to_cp_list(const unsigned char *utf8, const int size, unsigned int *cp_array, const int max_array_size, int *array_count)
static void make_coll_key(UCA_COLL_KEY *key, UCA_COLL_KEY_TYPE type, const int key_id)
static int read_cp_from_tag(unsigned char *buffer, CP_BUF_TYPE type, UCA_CP *cp)
COLL_CONTRACTION * contr_list
#define snprintf_dots_truncate(dest, max_len,...)
static int comp_func_coll_contr_bin(const void *arg1, const void *arg2)
UCA_COLL_CE_LIST * coll_cp
struct uca_coll_key UCA_COLL_KEY
static int apply_tailoring_rule_identity(UCA_COLL_KEY *key, UCA_COLL_KEY *ref_key)
char step[MAX_STRLEN_FOR_COLLATION_ELEMENT]
static int string_to_coll_ce_list(char *s, UCA_COLL_CE_LIST *ui)
char start_weight[MAX_STRLEN_FOR_COLLATION_ELEMENT]
static UCA_W * w_occurences[MAX_WEIGHT_LEVELS]
#define LOG_LOCALE_ERROR(msg, er_status, do_print)
unsigned short int UCA_L4_W
COLL_CONTRACTION contr_ref
#define UCA_CONTR_EXP_CNT_GROW
static int optimize_coll_contractions(LOCALE_COLLATION *lc)
static int uca_comp_func_coll_key(const void *arg1, const void *arg2)
#define INTL_GET_NEXT_CONTR_ID(v)
static int add_opt_coll_contraction(LOCALE_COLLATION *lc, const UCA_COLL_KEY *contr_key, const unsigned int wv, bool use_expansions)
static int set_next_value_for_coll_key(LOCALE_COLLATION *lc, const UCA_COLL_KEY *coll_key, const UCA_COLL_KEY *next_key)
static int add_key_to_weight_stats_list(const UCA_COLL_KEY *key, UCA_W wv)
unsigned int cp_first_contr_offset
static int add_uca_contr_or_exp(LOCALE_COLLATION *lc, UCA_STORAGE *storage, const unsigned int *cp_array, const int cp_count, const UCA_COLL_KEY_TYPE seq_type)
struct uca_coll_ce_list UCA_COLL_CE_LIST