MySQL 8.0.40
Source Code Documentation
uca9-dump.cc File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <map>
#include <set>
#include "m_string.h"
#include "my_compiler.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 char uchar
 
typedef unsigned short uint16
 
typedef unsigned int uint
 
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 change_zh_implicit (uint16 weight)
 
my_wc_t convert_implicit_to_ch (uint16 first, uint16 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

◆ uchar

typedef unsigned char uchar

◆ uint

typedef unsigned int uint

◆ uint16

typedef unsigned short uint16

Enumeration Type Documentation

◆ OPT_DUMP

enum OPT_DUMP
Enumerator
DUCET_DUMP 
JA_DUMP 
ZH_DUMP 
DUMP_ERROR 

Function Documentation

◆ change_zh_implicit()

uint16 change_zh_implicit ( uint16  weight)

◆ convert_implicit_to_ch()

my_wc_t convert_implicit_to_ch ( uint16  first,
uint16  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