CUBRID Engine  latest
unicode_support.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "porting.h"
#include "locale_support.h"
#include "intl_support.h"
#include "language_support.h"
#include "error_manager.h"
#include "utility.h"
#include "environment_variable.h"
#include "system_parameter.h"
#include "unicode_support.h"
Include dependency graph for unicode_support.c:

Go to the source code of this file.

Classes

struct  GENERAL_CATEGORY
 
struct  CANONICAL_COMBINING_CLASS
 
struct  UNICODE_CHAR
 
struct  UNICODE_CP_MAPPING
 

Macros

#define UNICODEDATA_FILE   "unicodedata.txt"
 
#define UNICODE_FILE_LINE_SIZE   512
 
#define UNICODE_FILE_FIELDS   14
 
#define UNICODE_FILE_GENERAL_CAT_POS   2
 
#define UNICODE_FILE_CHAR_DECOMPOSITION_MAPPING   5
 
#define UNICODE_FILE_UPPER_CASE_MAP   12
 
#define UNICODE_FILE_LOWER_CASE_MAP   13
 
#define UNICODE_DECOMP_MAP_CP_COUNT   4
 

Enumerations

enum  GENERAL_CATEG_ID { CAT_Cn = 0, CAT_Lu, CAT_Ll, CAT_MAX }
 

Functions

static int load_unicode_data (const LOCALE_DATA *ld)
 
static int create_alphabet (ALPHABET_DATA *a, const int max_letters, const int lower_multiplier, const int upper_multiplier)
 
static int count_full_decomp_cp (int cp)
 
static int count_decomp_steps (int cp)
 
static int unicode_make_normalization_data (UNICODE_CP_MAPPING *decomp_maps, LOCALE_DATA *ld)
 
static int comp_func_unicode_cp_mapping (const void *arg1, const void *arg2)
 
static int comp_func_grouping_unicode_cp_mapping (const void *arg1, const void *arg2)
 
int unicode_process_alphabet (LOCALE_DATA *ld, bool is_verbose)
 
void unicode_free_data (void)
 
int string_to_int_array (char *s, uint32 *cp_list, const int cp_list_size, const char *delims)
 
int unicode_process_normalization (LOCALE_DATA *ld, bool is_verbose)
 
bool unicode_string_need_compose (const char *str_in, const int size_in, int *size_out, const UNICODE_NORMALIZATION *norm)
 
void unicode_compose_string (const char *str_in, const int size_in, char *str_out, int *size_out, bool *is_composed, const UNICODE_NORMALIZATION *norm)
 
bool unicode_string_need_decompose (const char *str_in, const int size_in, int *decomp_size, const UNICODE_NORMALIZATION *norm)
 
void unicode_decompose_string (const char *str_in, const int size_in, char *str_out, int *size_out, const UNICODE_NORMALIZATION *norm)
 

Variables

GENERAL_CATEGORY list_gen_cat []
 
static UNICODE_CHARunicode_data = NULL
 
static int unicode_data_lower_mult = 1
 
static int unicode_data_upper_mult = 1
 
static char last_unicode_file [PATH_MAX] = { 0 }
 

Macro Definition Documentation

#define UNICODE_DECOMP_MAP_CP_COUNT   4

Definition at line 84 of file unicode_support.c.

Referenced by load_unicode_data(), and unicode_make_normalization_data().

#define UNICODE_FILE_CHAR_DECOMPOSITION_MAPPING   5

Definition at line 48 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODE_FILE_FIELDS   14

Definition at line 44 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODE_FILE_GENERAL_CAT_POS   2

Definition at line 47 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODE_FILE_LINE_SIZE   512

Definition at line 43 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODE_FILE_LOWER_CASE_MAP   13

Definition at line 50 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODE_FILE_UPPER_CASE_MAP   12

Definition at line 49 of file unicode_support.c.

Referenced by load_unicode_data().

#define UNICODEDATA_FILE   "unicodedata.txt"

Definition at line 40 of file unicode_support.c.

Referenced by load_unicode_data(), and unicode_process_alphabet().

Enumeration Type Documentation

Enumerator
CAT_Cn 
CAT_Lu 
CAT_Ll 
CAT_MAX 

Definition at line 52 of file unicode_support.c.

Function Documentation

static int comp_func_grouping_unicode_cp_mapping ( const void *  arg1,
const void *  arg2 
)
static

Definition at line 1450 of file unicode_support.c.

References UNICODE_CP_MAPPING::map.

Referenced by unicode_process_normalization().

Here is the caller graph for this function:

static int comp_func_unicode_cp_mapping ( const void *  arg1,
const void *  arg2 
)
static

Definition at line 1410 of file unicode_support.c.

References UNICODE_CP_MAPPING::cp, UNICODE_CP_MAPPING::map, and UNICODE_CP_MAPPING::size.

Referenced by unicode_process_normalization().

Here is the caller graph for this function:

static int count_decomp_steps ( int  cp)
static

Definition at line 997 of file unicode_support.c.

References MAX_UNICODE_CHARS, UNICODE_CHAR::unicode_mapping, and UNICODE_CHAR::unicode_mapping_cp_count.

Referenced by unicode_process_normalization().

Here is the caller graph for this function:

static int count_full_decomp_cp ( int  cp)
static

Definition at line 966 of file unicode_support.c.

References MAX_UNICODE_CHARS, UNICODE_CHAR::unicode_mapping, and UNICODE_CHAR::unicode_mapping_cp_count.

Referenced by unicode_process_normalization().

Here is the caller graph for this function:

static int create_alphabet ( ALPHABET_DATA a,
const int  max_letters,
const int  lower_multiplier,
const int  upper_multiplier 
)
static
int string_to_int_array ( char *  s,
uint32 cp_list,
const int  cp_list_size,
const char *  delims 
)

Definition at line 661 of file unicode_support.c.

References assert, i, NULL, str_to_uint32(), and strlen.

Referenced by load_ducet(), and load_unicode_data().

Here is the caller graph for this function:

void unicode_decompose_string ( const char *  str_in,
const int  size_in,
char *  str_out,
int *  size_out,
const UNICODE_NORMALIZATION norm 
)
void unicode_free_data ( void  )

Definition at line 565 of file unicode_support.c.

References last_unicode_file, and NULL.

Referenced by load_unicode_data(), and locale_compile_locale().

Here is the caller graph for this function:

bool unicode_string_need_compose ( const char *  str_in,
const int  size_in,
int *  size_out,
const UNICODE_NORMALIZATION norm 
)

Definition at line 1128 of file unicode_support.c.

References assert, NULL, prm_get_bool_value(), and PRM_ID_UNICODE_INPUT_NORMALIZATION.

Referenced by csql_help_schema(), csql_help_trigger(), jsp_unpack_string_value(), and netval_to_dbval().

Here is the caller graph for this function:

bool unicode_string_need_decompose ( const char *  str_in,
const int  size_in,
int *  decomp_size,
const UNICODE_NORMALIZATION norm 
)

Variable Documentation

char last_unicode_file[PATH_MAX] = { 0 }
static

Definition at line 114 of file unicode_support.c.

Referenced by load_unicode_data(), and unicode_free_data().

GENERAL_CATEGORY list_gen_cat[]
Initial value:
= {
{CAT_Lu, "Lu"},
{CAT_Ll, "Ll"},
}

Definition at line 70 of file unicode_support.c.

UNICODE_CHAR* unicode_data = NULL
static

Definition at line 110 of file unicode_support.c.

int unicode_data_lower_mult = 1
static

Definition at line 111 of file unicode_support.c.

Referenced by load_unicode_data(), and unicode_process_alphabet().

int unicode_data_upper_mult = 1
static

Definition at line 112 of file unicode_support.c.

Referenced by load_unicode_data(), and unicode_process_alphabet().