MySQL 9.1.0
Source Code Documentation
uca9-dump.cc File Reference
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <map>
#include <utility>
#include "m_string.h"
#include "my_compiler.h"
#include "mysql/strings/m_ctype.h"
#include "strings/mb_wc.h"
#include "strings/uca900_data.h"

Classes

struct  MY_UCA_ITEM
 
struct  MY_UCA
 

Macros

#define MY_UCA_MAXWEIGHT_TO_PARSE   64
 
#define MY_UCA_MAXCE_TO_PARSE   18
 
#define MY_UCA_MAXWEIGHT_TO_DUMP   24
 
#define MY_UCA_MAXCE_TO_DUMP   8
 
#define MY_UCA_VERSION_SIZE   32
 
#define MY_UCA_CE_SIZE   3
 
#define MY_UCA_MAX_CONTRACTION   6
 
#define MY_UCA_MAXCHAR   (0x10FFFF + 1)
 
#define MY_UCA_CHARS_PER_PAGE   256
 
#define MY_UCA_PSHIFT   8
 
#define MY_UCA_NPAGES   MY_UCA_MAXCHAR / MY_UCA_CHARS_PER_PAGE
 
#define HANGUL_JAMO_MAX_LENGTH   3
 

Typedefs

typedef unsigned long my_wc_t
 

Enumerations

enum  OPT_DUMP { DUCET_DUMP , JA_DUMP , ZH_DUMP , DUMP_ERROR }
 

Functions

static int load_uca_file (MY_UCA *uca, int maxchar, int *pageloaded, FILE *infile)
 
static int my_decompose_hangul_syllable (my_wc_t syllable, my_wc_t *jamo)
 
void my_put_jamo_weights (const my_wc_t *hangul_jamo, int jamo_cnt, MY_UCA_ITEM *item, const MY_UCA *uca)
 
static void set_implicit_weights (MY_UCA_ITEM *item, int code)
 
static void set_implicit_weights (MY_UCA *uca, const int *pageloaded)
 
static void get_page_statistics (const MY_UCA *uca, int page, int *maxnum)
 
static char * prefix_name (const MY_UCA *uca)
 
static char * page_name (const MY_UCA *uca, int page, bool pageloaded)
 
static void print_one_page (const MY_UCA *uca, int page, const char *page_name_prefix, int maxnum, FILE *outfile)
 
int read_in_lang_data (char *inbytes, int maxbytes, FILE *infile)
 
int dump_ja_hans (MY_UCA *uca, FILE *infile, FILE *outfile)
 
uint16_t change_zh_implicit (uint16_t weight)
 
my_wc_t convert_implicit_to_ch (uint16_t first, uint16_t second)
 
int dump_zh_hans (MY_UCA *uca, int *pageloaded, FILE *infile, FILE *outfile)
 
OPT_DUMP handle_options (int ac, char **av, char **infilename, char **outfilename)
 
int dump_ducet (MY_UCA *uca, int *pageloaded, FILE *infile, FILE *outfile)
 
int main (int ac, char **av)
 

Macro Definition Documentation

◆ HANGUL_JAMO_MAX_LENGTH

#define HANGUL_JAMO_MAX_LENGTH   3

◆ MY_UCA_CE_SIZE

#define MY_UCA_CE_SIZE   3

◆ MY_UCA_CHARS_PER_PAGE

#define MY_UCA_CHARS_PER_PAGE   256

◆ MY_UCA_MAX_CONTRACTION

#define MY_UCA_MAX_CONTRACTION   6

◆ MY_UCA_MAXCE_TO_DUMP

#define MY_UCA_MAXCE_TO_DUMP   8

◆ MY_UCA_MAXCE_TO_PARSE

#define MY_UCA_MAXCE_TO_PARSE   18

◆ MY_UCA_MAXCHAR

#define MY_UCA_MAXCHAR   (0x10FFFF + 1)

◆ MY_UCA_MAXWEIGHT_TO_DUMP

#define MY_UCA_MAXWEIGHT_TO_DUMP   24

◆ MY_UCA_MAXWEIGHT_TO_PARSE

#define MY_UCA_MAXWEIGHT_TO_PARSE   64

◆ MY_UCA_NPAGES

#define MY_UCA_NPAGES   MY_UCA_MAXCHAR / MY_UCA_CHARS_PER_PAGE

◆ MY_UCA_PSHIFT

#define MY_UCA_PSHIFT   8

◆ MY_UCA_VERSION_SIZE

#define MY_UCA_VERSION_SIZE   32

Typedef Documentation

◆ my_wc_t

typedef unsigned long my_wc_t

Enumeration Type Documentation

◆ OPT_DUMP

enum OPT_DUMP
Enumerator
DUCET_DUMP 
JA_DUMP 
ZH_DUMP 
DUMP_ERROR 

Function Documentation

◆ change_zh_implicit()

uint16_t change_zh_implicit ( uint16_t  weight)

◆ convert_implicit_to_ch()

my_wc_t convert_implicit_to_ch ( uint16_t  first,
uint16_t  second 
)

◆ dump_ducet()

int dump_ducet ( MY_UCA uca,
int *  pageloaded,
FILE *  infile,
FILE *  outfile 
)

◆ dump_ja_hans()

int dump_ja_hans ( MY_UCA uca,
FILE *  infile,
FILE *  outfile 
)

◆ dump_zh_hans()

int dump_zh_hans ( MY_UCA uca,
int *  pageloaded,
FILE *  infile,
FILE *  outfile 
)

◆ get_page_statistics()

static void get_page_statistics ( const MY_UCA uca,
int  page,
int *  maxnum 
)
static

◆ handle_options()

OPT_DUMP handle_options ( int  ac,
char **  av,
char **  infilename,
char **  outfilename 
)

◆ load_uca_file()

static int load_uca_file ( MY_UCA uca,
int  maxchar,
int *  pageloaded,
FILE *  infile 
)
static

◆ main()

int main ( int  ac,
char **  av 
)

◆ my_decompose_hangul_syllable()

static int my_decompose_hangul_syllable ( my_wc_t  syllable,
my_wc_t jamo 
)
static

◆ my_put_jamo_weights()

void my_put_jamo_weights ( const my_wc_t hangul_jamo,
int  jamo_cnt,
MY_UCA_ITEM item,
const MY_UCA uca 
)

◆ page_name()

static char * page_name ( const MY_UCA uca,
int  page,
bool  pageloaded 
)
static

◆ prefix_name()

static char * prefix_name ( const MY_UCA uca)
static

◆ print_one_page()

static void print_one_page ( const MY_UCA uca,
int  page,
const char *  page_name_prefix,
int  maxnum,
FILE *  outfile 
)
static

◆ read_in_lang_data()

int read_in_lang_data ( char *  inbytes,
int  maxbytes,
FILE *  infile 
)

◆ set_implicit_weights() [1/2]

static void set_implicit_weights ( MY_UCA uca,
const int *  pageloaded 
)
static

◆ set_implicit_weights() [2/2]

static void set_implicit_weights ( MY_UCA_ITEM item,
int  code 
)
static