CUBRID Engine  latest
locale_support.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * locale_support.h : Locale support using LDML files
22  *
23  */
24 
25 #ifndef _LOCALE_SUPPORT_H_
26 #define _LOCALE_SUPPORT_H_
27 
28 #ident "$Id$"
29 
30 #include <stddef.h>
31 #include "porting.h"
32 #include "dbtype_def.h"
33 #include "locale_lib_common.h"
34 
35 /* Maximum Unicode characters
36  * Do not change this above 65536 */
37 #define MAX_UNICODE_CHARS 65536
38 
39 /* Allowed multiplier for data string casing.
40  * How many times a string can grow or shrink (in characters) when performing
41  * lower / upper */
42 #define INTL_CASING_EXPANSION_MULTIPLIER 2
43 
44 /* Allowed multiplier for identifier casing.
45  * How many times a string identifier can grow (in bytes size) when
46  * performing lower / upper on DB identifiers.
47  * This growing can occur only in UTF-8 charset (see Unicode data, for example
48  * lower case for U+023A is U+2C65 - 2 bytes to 3 bytes).
49  * This restriction does not apply to user strings.
50  * The Turkish rules for casing do not apply on identifiers, only for user
51  * strings. Identifier casing rules are the same for locales, assuming they
52  * use the same charset and Unicode data (built-in en_US.utf8,ko_KR.utf8 and
53  * tr_TR.utf8 have different Unicode data then LDML de_DE.utf8, hence they
54  * produce different identifier casing rules).
55  */
56 #define INTL_IDENTIFIER_CASING_SIZE_MULTIPLIER 2
57 
58 /* Mask for next sequence. Used to determine next string in sorting order
59  * in LIKE operator.
60  * If the value of 'next' has this bit set, then the next sequence is a
61  * contraction, and the lower part of value indicates the contraction id
62  * Otherwise, the 'next' value indicates a Unicode codepoint */
63 #define INTL_MASK_CONTR 0x80000000
64 
65 #define INTL_IS_NEXT_CONTR(v) \
66  (((v) & INTL_MASK_CONTR) == INTL_MASK_CONTR)
67 
68 #define INTL_GET_NEXT_CONTR_ID(v) ((v) & (~INTL_MASK_CONTR))
69 
70 /*
71  * Encoding of L1-L3 UCA weights on 32 bit unsigned int:
72  * 33333332 22222222 1111111 1111111
73  * L1 = 0000-ffff
74  * L2 = 0000-01ff
75  * L3 = 0000-007f
76  */
77 #define UCA_GET_L1_W(v) ((v) & 0x0000ffff)
78 #define UCA_GET_L2_W(v) (((v) & 0x01ff0000) >> 16)
79 #define UCA_GET_L3_W(v) (((v) & 0xfe000000) >> 25)
80 
81 #define LOC_LOCALE_STR_SIZE 10
82 #define LOC_DATA_BUFF_SIZE 256
83 
84 #define COLL_NAME_SIZE 32
85 #define LOC_LIB_SYMBOL_NAME_SIZE 64
86 
87 
88 /* constants for Gregorian calendar */
89 #define CAL_MONTH_COUNT 12
90 #define CAL_DAY_COUNT 7
91 #define CAL_AM_PM_COUNT 12
92 
93 /* Length in character of abbreviated format text for month : "Mon" */
94 #define LOC_CAL_FMT_MONTH_ABBR_LEN 3
95 /* Length in character of wide format text for month : "Month" */
96 #define LOC_CAL_FMT_MONTH_WIDE_LEN 5
97 /* Length in character of abbreviated format text for day : "Dy" */
98 #define LOC_CAL_FMT_DAY_ABBR_LEN 2
99 /* Length in character of wide format text for day : "Day" */
100 #define LOC_CAL_FMT_DAY_WIDE_LEN 3
101 /* Length in character of wide format text for day : "AM" */
102 #define LOC_CAL_FMT_AM_LEN 2
103 
104 /* Multiplier for number of characters that a calendar token can have;
105  * It applies for each token format text.
106  * Current value is set based on the 'Day' format text and longest day name
107  * in km_KH which is 14 chars */
108 #define LOC_PARSE_FRMT_TO_TOKEN_MULT 5
109 
110 #define LOC_DATA_MONTH_ABBR_SIZE (LOC_CAL_FMT_MONTH_ABBR_LEN) * \
111  (LOC_PARSE_FRMT_TO_TOKEN_MULT) * \
112  (INTL_UTF8_MAX_CHAR_SIZE)
113 #define LOC_DATA_MONTH_WIDE_SIZE (LOC_CAL_FMT_MONTH_WIDE_LEN) * \
114  (LOC_PARSE_FRMT_TO_TOKEN_MULT) * \
115  (INTL_UTF8_MAX_CHAR_SIZE)
116 
117 #define LOC_DATA_DAY_ABBR_SIZE (LOC_CAL_FMT_DAY_ABBR_LEN) * \
118  (LOC_PARSE_FRMT_TO_TOKEN_MULT) * \
119  (INTL_UTF8_MAX_CHAR_SIZE)
120 
121 #define LOC_DATA_DAY_WIDE_SIZE (LOC_CAL_FMT_DAY_WIDE_LEN) * \
122  (LOC_PARSE_FRMT_TO_TOKEN_MULT) * \
123  (INTL_UTF8_MAX_CHAR_SIZE)
124 
125 #define LOC_DATA_AM_PM_SIZE (LOC_CAL_FMT_AM_LEN) * \
126  (LOC_PARSE_FRMT_TO_TOKEN_MULT) * \
127  (INTL_UTF8_MAX_CHAR_SIZE)
128 
129 #define LOC_DATA_CURRENCY_ISO_CODE_LEN 3
130 
131 #define LOC_DATA_COLL_TWO_CHARS 13
132 #define LOC_DATA_TAILOR_RULES_COUNT_GROW 128
133 #define LOC_DATA_COLL_CUBRID_TAILOR_COUNT_GROW 8
134 #define MAX_STRLEN_FOR_COLLATION_ELEMENT 136
135 
136 #define DUMPLOCALE_IS_CALENDAR 1
137 #define DUMPLOCALE_IS_NUMBERING (1 << 1)
138 #define DUMPLOCALE_IS_ALPHABET (1 << 2)
139 #define DUMPLOCALE_IS_ALPHABET_LOWER (1 << 3)
140 #define DUMPLOCALE_IS_ALPHABET_UPPER (1 << 4)
141 #define DUMPLOCALE_IS_IDENTIFIER_ALPHABET (1 << 5)
142 #define DUMPLOCALE_IS_IDENTIFIER_ALPHABET_LOWER (1 << 6)
143 #define DUMPLOCALE_IS_IDENTIFIER_ALPHABET_UPPER (1 << 7)
144 #define DUMPLOCALE_IS_COLLATION_CP_ORDER (1 << 8)
145 #define DUMPLOCALE_IS_COLLATION_WEIGHT_ORDER (1 << 9)
146 #define DUMPLOCALE_IS_NORMALIZATION (1 << 10)
147 #define DUMPLOCALE_IS_TEXT_CONV (1 << 11)
148 
149 #define ERR_MSG_SIZE 512
150 
151 #define LOG_LOCALE_ERROR(msg, er_status, do_print) \
152  do { \
153  er_set (ER_ERROR_SEVERITY, ARG_FILE_LINE, er_status, 1, msg); \
154  if (do_print) \
155  { \
156  fprintf (stderr, "Error processing locales: %s\n", msg); \
157  util_log_write_errstr ("Error processing locales: %s\n", msg); \
158  } \
159  } while (0)
160 
161 #define MAPPING_INDEX_MASK 0x100000
162 
163 #define SET_MAPPING_INDEX(val, is_used, offset) \
164  do { \
165  val = (offset); \
166  if (is_used) \
167  { \
168  val |= MAPPING_INDEX_MASK; \
169  } \
170  } while (0);
171 
172 #define CP_HAS_MAPPINGS(val) \
173  (((val) & MAPPING_INDEX_MASK) == MAPPING_INDEX_MASK)
174 
175 #define GET_MAPPING_OFFSET(val) ((val) & ~MAPPING_INDEX_MASK)
176 
177 typedef unsigned short UCA_CP;
178 typedef unsigned short UCA_W;
179 
180 typedef struct locale_file LOCALE_FILE;
182 {
183  char *locale_name;
184  char *ldml_file;
185  char *lib_file;
186 };
187 
188 typedef struct ldml_context LDML_CONTEXT;
190 {
191  char *ldml_file;
192  int line_no;
193 };
194 
195 /* Collation structures */
196 /* Tailoring level */
197 typedef enum
198 {
205 } T_LEVEL;
206 
207 /* Tailoring anchoring direction */
208 typedef enum
209 {
212 } TAILOR_DIR;
213 
214 /* Type of char data. If tag is cp, ecp, buffer type ill be BUF_TYPE_CODE
215  * If tag is ch, ech, buffer type will be BUF_TYPE_CHAR. */
216 typedef enum
217 {
220 } CP_BUF_TYPE;
221 
222 /* Tailoring position */
223 typedef enum
224 {
225  RULE_POS_BUFFER = 0, /* Non-logical position, use buffer */
226 
227  RULE_POS_FIRST_VAR, /* Logical first variable */
228  RULE_POS_LAST_VAR, /* Logical last variable */
229 
230  RULE_POS_FIRST_PRI_IGN, /* Logical first primary ignorable */
231  RULE_POS_LAST_PRI_IGN, /* Logical last primary ignorable */
232 
233  RULE_POS_FIRST_SEC_IGN, /* Logical first secondary ignorable */
234  RULE_POS_LAST_SEC_IGN, /* Logical last secondary ignorable */
235 
236  RULE_POS_FIRST_TERT_IGN, /* Logical first tertiary ignorable */
237  RULE_POS_LAST_TERT_IGN, /* Logical last tertiary ignorable */
238 
239  RULE_POS_FIRST_NON_IGN, /* Logical first non-ignorable */
240  RULE_POS_LAST_NON_IGN, /* Logical last non-ignorable */
241 
242  RULE_POS_FIRST_TRAIL, /* Logical first trailing */
243  RULE_POS_LAST_TRAIL /* Logical last trailing */
244 } RULE_POS_TYPE;
245 
246 typedef struct tailor_rule TAILOR_RULE;
248 {
249  T_LEVEL level; /* weight level : primary, .. identity */
250 
251  /* anchor (reference) buffer, for which the rule is defined it may contain one or two (for expansion rule) UTF-8
252  * chars buffer is nul-terminated */
253  char anchor_buf[LOC_DATA_COLL_TWO_CHARS];
254 
255  /* Reference : */
256  RULE_POS_TYPE r_pos_type; /* processing flag : logical position or buffer value for reference */
257  char *r_buf; /* Buffer containing UTF-8 characters of reference */
259 
260  TAILOR_DIR direction; /* direction for applying rule : after, before */
261 
262  /* Buffer containing UTF-8 characters to be tailored */
263  /* buffer is NOT nul-terminated */
264  char *t_buf;
266 
267  bool multiple_chars; /* true : indicates a rule for tailoring multiple chars false : rule for a single
268  * character */
269 };
270 
271 
272 /*
273  * CUBRID_TAILOR_RULE - Structure used for representing the rules for
274  * absolute tailoring e.g. manually setting the weights
275  * and collation elements for unicode character or
276  * character ranges.
277 */
280 {
281  /* The first and last (incl.) codepoints of the codepoint range to be tailored, in text format for later validation
282  * and parsing. */
283  char start_cp_buf[LOC_DATA_BUFF_SIZE];
284  char end_cp_buf[LOC_DATA_BUFF_SIZE];
287 
289  /* Buffer containing the weight value to use in the rule. Buffer is NOT NULL-terminated. Example :
290  * [100.0.0.0][0.0.0.2]...etc. */
291 
293  /* The step (per level) with which we increase the weight range. Default value is 0 for all levels, so
294  * single-codepoint and identical tailoring can be easily implemented. */
295 };
296 
297 typedef enum
298 {
303 
304 /* Matching of a pattern containing a contraction starter on last position:
305  * if "ch" is a contraction, then :
306  * "bac" is not matched in "bachxxx", if MATCH_CONTR_BOUND_FORBID
307  * "bac" is matched in "bachxxx", if MATCH_CONTR_BOUND_ALLOW */
308 typedef enum
309 {
313 
314 /* UCA sort options */
315 typedef struct uca_options UCA_OPTIONS;
317 {
318  /* collation settings */
319  T_LEVEL sett_strength; /* collation strength (primary, .. identity) */
320  bool sett_backwards; /* backwards on/off */
321  bool sett_caseLevel; /* caseLevel on/off */
322  int sett_caseFirst; /* 0=off; 1=upper ; 2=lower */
323  bool sett_expansions; /* use expansions */
324 
325  /* how to handle contractions, should be regarded as bit-field flag */
327 
328  /* set only when sorting for 'next' with expansions : not serialized */
330 
331  /* how to handle string matching when contractions spans over the boundary */
333 };
334 
335 /* Below there are members containing the symbol name from where to load
336  * certain weight arrays. By default, the symbol name is the corresponding
337  * name of the exported weight array. However, if 2 collations have
338  * identical weight arrays after compiling, the symbol name corresponding to
339  * one of the arrays will be set to the name of the other, and the actual
340  * array will not be exported into the shared library */
343 {
344  char coll_weights_ref[LOC_LIB_SYMBOL_NAME_SIZE];
345  char coll_next_cp_ref[LOC_LIB_SYMBOL_NAME_SIZE];
346  char coll_uca_num_ref[LOC_LIB_SYMBOL_NAME_SIZE];
347  char coll_uca_w_l13_ref[LOC_LIB_SYMBOL_NAME_SIZE];
348  char coll_uca_w_l4_ref[LOC_LIB_SYMBOL_NAME_SIZE];
349  char coll_contr_list_ref[LOC_LIB_SYMBOL_NAME_SIZE];
350  char coll_cp_first_contr_array_ref[LOC_LIB_SYMBOL_NAME_SIZE];
351 };
352 
353 typedef struct coll_data COLL_DATA;
354 struct coll_data
355 {
356  int coll_id; /* collation id */
357  char coll_name[COLL_NAME_SIZE]; /* collation name */
358 
360 
361  unsigned int *weights; /* array of weight (one weight per CP) */
362  unsigned int *next_cp; /* next CP (in order defined by collation) */
363  unsigned int *weights_ti; /* array of weight for ignore trailing space */
364  unsigned int *next_cp_ti; /* next CP (for ignore trailing space) */
365 
366  int w_count; /* # of codepoints in this collation */
367 
368  /* Size of uca_w = 'w_count' X 'uca_exp_num' X 'sizeof (UCA_W)' */
369  /* For each codepoint entry in uca_w only the corresponding uca_num weights are used */
370  int uca_exp_num; /* max number of CE per codepoint */
371  char *uca_num; /* number of CE for each codepoint */
372  UCA_L13_W *uca_w_l13; /* weight array L1, L2, L3 */
374 
375  COLL_CONTRACTION *contr_list; /* contactions lists; contractions are stored in binary ascending order of UTF-8 buffer
376  */
378  int contr_min_size; /* size of smallest contraction buffer (in bytes) */
379 
380  /* array of first contraction index for each codepoint contains 'w_count' elements : value -1 means CP is not a
381  * contraction starter other value = index of contraction in contractions list ('contr_list') */
383  /* codepoint value from which 'cp_first_contr_array' can be used */
384  unsigned int cp_first_contr_offset;
385  /* # of codepoints in 'cp_first_contr_array' */
386  unsigned int cp_first_contr_count;
387 
388  char checksum[32 + 1];
389 };
390 
393 {
394  char coll_name[COLL_NAME_SIZE]; /* collation name */
395 
396  int coll_id;
397 
399 
400  /* number of codepoints to take into account for collation -1 means unlimited (we support up to MAX_UNICODE_CHARS) */
402 
403  /* collation tailoring rules */
404  int count_rules; /* # of tailorings */
405  int max_rules; /* # of max (allocated tailorings) */
406  TAILOR_RULE *rules; /* tailoring rules */
407 
408  CUBRID_TAILOR_RULE *cub_rules; /* absolute tailoring rules */
409  int cub_count_rules; /* # of tailorings */
410  int cub_max_rules; /* # of max (allocated tailorings) */
412 };
413 
414 
415 /* Alphabet usage mode :
416  * - built-in routines codeset specific (lower_cp, upper_cp not used)
417  * - using data in lower_cp, upper_cp arrays
418  * */
419 typedef enum
420 {
424 
425 /* Alphabet generation type :
426  * in case several locales use the same UNICODE or ASCII modes, only one
427  * reference copy is loaded */
428 typedef enum
429 {
433 } ALPHABET_TYPE;
434 
435 /* alphabet structures (lower, upper) */
438 {
440  int codeset; /* codeset of alphabet : not serialized */
441  int l_count; /* number of elements */
442 
443  int lower_multiplier; /* how many codepoints contains each lower entry */
444  unsigned int *lower_cp; /* lower CP */
445 
446  int upper_multiplier; /* how many codepoints contains each upper entry */
447  unsigned int *upper_cp; /* upper CP */
448 
449  bool do_not_save; /* used by genlocale if shared alphabet */
450 };
451 
452 typedef enum
453 {
454  TR_UPPER = 0,
457 
458 /* Describes how a text tranforms into another text
459  * Used for lower / upper casing rule description */
462 {
464 
465  char *src;
466  int src_size;
467 
468  char *dest;
470 };
471 
472 
475 {
476  /* number of codepoints the optimization process will to take into account for casing : -1 means unlimited (we
477  * support up to MAX_UNICODE_CHARS) */
479 
480  int alphabet_mode; /* 0 : default UnicodeData 1 : UnicodeData with specified file 2 : ASCII letter and
481  * casing */
482  /* file path for Unicode data (if 'alphabet_mode' == 1) */
483  char unicode_data_file[PATH_MAX];
484 
485  int count_rules; /* # of tailorings */
486  int max_rules; /* # of max (allocated tailorings) */
489 };
490 
491 /* text conversions */
492 typedef enum
493 {
497  TEXT_CONV_GENERIC_1BYTE, /* user defined UTF-8 to single byte codepage */
498  TEXT_CONV_GENERIC_2BYTE /* user defined UTF-8 to double byte codepage */
500 
501 #define TXT_CONV_SYSTEM_STR_SIZE 256
504 {
506 
507  /* both identifiers are used to ensure locale binary files portability */
508  char *win_codepages; /* Windows codepage identifier */
509  char *nl_lang_str; /* Linux language string */
510 
511  unsigned char byte_flag[256]; /* used in DBCS encoding schemes : 0 : single byte character 1 : leading byte for
512  * double byte char 2 : invalid byte */
513  /* UTF-8 to text */
514  unsigned int utf8_first_cp;
515  unsigned int utf8_last_cp;
517 
518  /* text to UTF-8 */
519  unsigned int text_first_cp;
520  unsigned int text_last_cp;
522 
523  int (*utf8_to_text_func) (const char *, const int, char **, int *);
524  int (*text_to_utf8_func) (const char *, const int, char **, int *);
525  void (*init_conv_func) (void);
526 };
527 
530 {
532 
533  char win_codepages[TXT_CONV_SYSTEM_STR_SIZE]; /* Windows codepage identifier */
534  char nl_lang_str[TXT_CONV_SYSTEM_STR_SIZE]; /* Linux language string */
535 
536  char conv_file[PATH_MAX];
537 };
538 
539 #define UNICODE_NORMALIZATION_DECORATOR "std"
540 
543 {
545  int unicode_mappings_count; /* total number of mappings, fully, partially or not decomposed. */
548 
550 };
551 
552 #define CAL_SIMPLE_DATE_FORMAT_SIZE 30
553 #define CAL_COMP_DATE_FORMAT_SIZE 48
554 #define CAL_SIMPLE_DATE_TZ_FORMAT_SIZE 52
555 #define CAL_COMP_DATE_TZ_FORMAT_SIZE 70
556 
557 /* user defined LOCALE DATA */
560 {
561  COLL_TAILORING tail_coll; /* collation info gathered from LDML */
562  COLL_DATA opt_coll; /* optimized collation data */
563  COLL_DATA_REF coll_ref; /* collation array export identifiers */
564  bool do_not_save; /* set true if collation is shared and already processed */
565 };
566 
567 typedef struct locale_data LOCALE_DATA;
569 {
570  /* name of locale : used for validation; should be set by application, before LDML parsing */
572 
573  /* calendar info : only Gregorian calendar is supported */
574  char dateFormat[CAL_SIMPLE_DATE_FORMAT_SIZE]; /* date format */
575  char timeFormat[CAL_SIMPLE_DATE_FORMAT_SIZE]; /* time format */
576 
577  char datetimeFormat[CAL_COMP_DATE_FORMAT_SIZE]; /* datetime format */
578  char timestampFormat[CAL_COMP_DATE_FORMAT_SIZE]; /* datetime format */
579 
580  char timetzFormat[CAL_SIMPLE_DATE_TZ_FORMAT_SIZE]; /* timetz format */
581  char datetimetzFormat[CAL_COMP_DATE_TZ_FORMAT_SIZE]; /* datetimetz format */
582  char timestamptzFormat[CAL_COMP_DATE_TZ_FORMAT_SIZE]; /* timestamptz format */
583 
584  /* name of months , week days, day periods */
585  char month_names_abbreviated[CAL_MONTH_COUNT][LOC_DATA_MONTH_ABBR_SIZE];
586  char month_names_wide[CAL_MONTH_COUNT][LOC_DATA_MONTH_WIDE_SIZE];
587  char day_names_abbreviated[CAL_DAY_COUNT][LOC_DATA_DAY_ABBR_SIZE];
588  char day_names_wide[CAL_DAY_COUNT][LOC_DATA_DAY_WIDE_SIZE];
590 
591  char month_names_abbr_parse_order[CAL_MONTH_COUNT];
592  char month_names_wide_parse_order[CAL_MONTH_COUNT];
593  char day_names_abbr_parse_order[CAL_DAY_COUNT];
594  char day_names_wide_parse_order[CAL_DAY_COUNT];
595  char am_pm_parse_order[CAL_AM_PM_COUNT];
596 
597  /* numeric symbols : digit grouping, decimal */
600  DB_CURRENCY default_currency_code; /* ISO code for default locale currency. */
601 
603  int coll_cnt;
604 
606  ALPHABET_DATA alphabet; /* data for user lower / uppper */
607  ALPHABET_DATA identif_alphabet; /* data for lower / uppper for identifiers */
608 
609  /* unicode data file used for alphabets and normalization */
610  int unicode_mode; /* 0 : default UnicodeData 1 : UnicodeData with specified file */
611  /* file path for Unicode data (if 'alphabet_mode' == 1) */
612  char unicode_data_file[PATH_MAX];
613 
614  /* normalization */
616 
617  /* console text conversion */
620 
621  /* data members used during processing : */
622  int curr_period; /* processing index for calendar : 0-11 : months 0-6 : week days 0-12 : AM, PM period
623  * names */
624  int name_type; /* processing flag for calendar name : 1 - abbr 2 - wide; 0 - uninitialized */
625 
626  /* processing : last anchor : used when build a new collation rule */
627  /* buffer is nul-terminated */
628  char last_anchor_buf[LOC_DATA_COLL_TWO_CHARS];
629  RULE_POS_TYPE last_rule_pos_type; /* processing flag : logical position or buffer */
630  TAILOR_DIR last_rule_dir; /* processing flag : after, before */
631  T_LEVEL last_rule_level; /* processing flag : weight level : primary, .. identity (used for validation) */
632 
633  /* processing : last tailoring reference : used when building collation rules pointer to a buffer : either a
634  * tailoring buffer (not nul-terminated) in a rule or an anchor buffer (last_anchor_buf) */
637 
638  /* processing : used for intermediary (partial) content data in LDML buffer is nul-terminated */
639  char data_buffer[LOC_DATA_BUFF_SIZE];
641 
642  char checksum[32 + 1];
643 
645 };
646 
647 #ifdef __cplusplus
648 extern "C"
649 {
650 #endif
651 
652  void locale_init_data (LOCALE_DATA * ld, const char *locale_name);
653  void locale_destroy_data (LOCALE_DATA * ld);
656  int locale_get_cfg_locales (LOCALE_FILE ** p_locale_files, int *p_num_locales, bool is_lang_init);
657  int locale_check_and_set_default_files (LOCALE_FILE * lf, bool is_lang_init);
658  int locale_prepare_C_file (void);
659  int locale_compile_locale (LOCALE_FILE * lf, LOCALE_DATA * ld, bool is_verbose);
660  void locale_mark_duplicate_collations (LOCALE_DATA ** ld, int start_index, int end_index, bool is_verbose);
661  int locale_save_all_to_C_file (LOCALE_DATA ** ld, int start_index, int end_index, LOCALE_FILE * lf);
662  int locale_dump (void *data, LOCALE_FILE * lf, int dl_settings, int start_value, int end_value);
663  int locale_dump_lib_collations (void *lib_handle, const LOCALE_FILE * lf, int dl_settings, int start_value,
664  int end_value);
665  void locale_free_shared_data (void);
666 
667 #ifdef __cplusplus
668 }
669 #endif
670 
671 #endif /* _LOCALE_SUPPORT_H_ */
COLL_MATCH_CONTR
void locale_destroy_normalization_data(UNICODE_NORMALIZATION *norm)
TAILOR_DIR
void locale_free_shared_data(void)
#define CAL_AM_PM_COUNT
#define CAL_COMP_DATE_TZ_FORMAT_SIZE
CONV_CP_TO_BYTES * utf8_to_text
UCA_OPTIONS uca_opt
bool sett_expansions
COLL_CONTR_POLICY
#define LOC_DATA_MONTH_ABBR_SIZE
LDML_CONTEXT ldml_context
#define CAL_MONTH_COUNT
char * locale_name
CP_BUF_TYPE start_cp_buf_type
ALPHABET_DATA identif_alphabet
TEXT_CONV_TYPE conv_type
ALPHABET_USE_MODE
COLL_MATCH_CONTR sett_match_contr
RULE_POS_TYPE
char * last_r_buf_p
RULE_POS_TYPE last_rule_pos_type
ALPHABET_TYPE a_type
T_LEVEL
RULE_POS_TYPE r_pos_type
unsigned int * weights_ti
void locale_mark_duplicate_collations(LOCALE_DATA **ld, int start_index, int end_index, bool is_verbose)
#define LOC_LIB_SYMBOL_NAME_SIZE
ALPHABET_DATA alphabet
#define LOC_DATA_DAY_ABBR_SIZE
UCA_OPTIONS uca_opt
TEXT_CONV_TYPE
#define LOC_DATA_AM_PM_SIZE
TEXT_CONV_TYPE conv_type
#define COLL_NAME_SIZE
bool use_only_first_ce
int locale_save_all_to_C_file(LOCALE_DATA **ld, int start_index, int end_index, LOCALE_FILE *lf)
char * ldml_file
#define CAL_SIMPLE_DATE_FORMAT_SIZE
DB_CURRENCY
Definition: dbtype_def.h:799
char number_group_sym
COLL_DATA_REF coll_ref
int locale_get_cfg_locales(LOCALE_FILE **p_locale_files, int *p_num_locales, bool is_lang_init)
UNICODE_MAPPING * unicode_mappings
CONV_CP_TO_BYTES * text_to_utf8
LOCALE_COLLATION * collations
CP_BUF_TYPE
unsigned short UCA_W
unsigned int text_first_cp
#define MAX_STRLEN_FOR_COLLATION_ELEMENT
unsigned int utf8_first_cp
COLL_TAILORING tail_coll
#define LOC_DATA_MONTH_WIDE_SIZE
#define CAL_DAY_COUNT
CUBRID_TAILOR_RULE * cub_rules
unsigned int cp_first_contr_count
void locale_destroy_data(LOCALE_DATA *ld)
unsigned int * lower_cp
CP_BUF_TYPE end_cp_buf_type
#define CAL_COMP_DATE_FORMAT_SIZE
char number_decimal_sym
ALPHABET_TYPE
int * cp_first_contr_array
unsigned int utf8_last_cp
TAILOR_RULE * rules
T_LEVEL last_rule_level
TRANSFORM_TYPE type
void locale_init_data(LOCALE_DATA *ld, const char *locale_name)
UNICODE_NORMALIZATION unicode_normalization
COLL_CONTRACTION * contr_list
UCA_L13_W * uca_w_l13
UCA_L4_W * uca_w_l4
int locale_compile_locale(LOCALE_FILE *lf, LOCALE_DATA *ld, bool is_verbose)
int locale_check_and_set_default_files(LOCALE_FILE *lf, bool is_lang_init)
#define CAL_SIMPLE_DATE_TZ_FORMAT_SIZE
int locale_dump(void *data, LOCALE_FILE *lf, int dl_settings, int start_value, int end_value)
#define LOC_LOCALE_STR_SIZE
TAILOR_DIR direction
unsigned int * next_cp
TRANSFORM_RULE * rules
DB_CURRENCY default_currency_code
TEXT_CONVERSION_PRM txt_conv_prm
#define TXT_CONV_SYSTEM_STR_SIZE
LDML_CONTEXT ldml_context
T_LEVEL sett_strength
unsigned int UCA_L13_W
void locale_destroy_alphabet_data(const ALPHABET_DATA *a)
unsigned short int UCA_L4_W
int locale_dump_lib_collations(void *lib_handle, const LOCALE_FILE *lf, int dl_settings, int start_value, int end_value)
int locale_prepare_C_file(void)
LDML_CONTEXT ldml_context
unsigned short UCA_CP
#define LOC_DATA_DAY_WIDE_SIZE
unsigned int text_last_cp
ALPHABET_TAILORING alpha_tailoring
unsigned int * next_cp_ti
unsigned int * weights
TAILOR_DIR last_rule_dir
TEXT_CONVERSION txt_conv
#define LOC_DATA_BUFF_SIZE
#define LOC_DATA_COLL_TWO_CHARS
int contr_min_size
TRANSFORM_TYPE
char * uca_num
unsigned int cp_first_contr_offset
unsigned int * upper_cp