enc/unicode.c File Reference

#include "regint.h"
#include "enc/unicode/name2ctype.h"
#include "enc/unicode/casefold.h"
#include "ruby/st.h"

Go to the source code of this file.

Data Structures

struct  CodePointList3
struct  CaseFold_11_Type
struct  CaseUnfold_11_Type
struct  CodePointList2
struct  CaseUnfold_12_Type
struct  CaseUnfold_13_Type

Defines

#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype)   ((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
#define numberof(array)   (int)(sizeof(array) / sizeof((array)[0]))
#define CODE_RANGES_NUM   numberof(CodeRanges)
#define PROPERTY_NAME_MAX_SIZE   (MAX_WORD_LENGTH + 1)

Functions

int onigenc_unicode_is_code_ctype (OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
int onigenc_unicode_ctype_code_range (int ctype, const OnigCodePoint *ranges[])
int onigenc_utf16_32_get_ctype_code_range (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], struct OnigEncodingTypeST *enc ARG_UNUSED)
int onigenc_unicode_property_name_to_ctype (OnigEncoding enc, UChar *name, UChar *end)
static int code2_cmp (OnigCodePoint *x, OnigCodePoint *y)
static st_index_t code2_hash (OnigCodePoint *x)
static int code3_cmp (OnigCodePoint *x, OnigCodePoint *y)
static st_index_t code3_hash (OnigCodePoint *x)
static int init_case_fold_table (void)
int onigenc_unicode_mbc_case_fold (OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED, const UChar **pp, const UChar *end, UChar *fold)
int onigenc_unicode_apply_all_case_fold (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc ARG_UNUSED)
int onigenc_unicode_get_case_fold_codes_by_str (OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[])

Variables

static const unsigned short EncUNICODE_ISO_8859_1_CtypeTable [256]
static struct st_hash_type type_code2_hash
static struct st_hash_type type_code3_hash
static st_tableFoldTable
static st_tableUnfold1Table
static st_tableUnfold2Table
static st_tableUnfold3Table
static int CaseFoldInited = 0


Define Documentation

#define CODE_RANGES_NUM   numberof(CodeRanges)

Definition at line 110 of file unicode.c.

Referenced by onigenc_unicode_ctype_code_range(), and onigenc_unicode_is_code_ctype().

#define numberof ( array   )     (int)(sizeof(array) / sizeof((array)[0]))

Definition at line 109 of file unicode.c.

#define ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE ( code,
ctype   )     ((EncUNICODE_ISO_8859_1_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)

Definition at line 32 of file unicode.c.

Referenced by onigenc_unicode_is_code_ctype().

#define PROPERTY_NAME_MAX_SIZE   (MAX_WORD_LENGTH + 1)

Definition at line 154 of file unicode.c.

Referenced by onigenc_unicode_property_name_to_ctype().


Function Documentation

static int code2_cmp ( OnigCodePoint x,
OnigCodePoint y 
) [static]

Definition at line 189 of file unicode.c.

static st_index_t code2_hash ( OnigCodePoint x  )  [static]

Definition at line 196 of file unicode.c.

static int code3_cmp ( OnigCodePoint x,
OnigCodePoint y 
) [static]

Definition at line 207 of file unicode.c.

static st_index_t code3_hash ( OnigCodePoint x  )  [static]

Definition at line 214 of file unicode.c.

static int init_case_fold_table ( void   )  [static]

Definition at line 231 of file unicode.c.

References CaseFold, CaseFold_Locale, CaseFoldInited, CaseUnfold_11, CaseUnfold_11_Locale, CaseUnfold_12, CaseUnfold_12_Locale, CaseUnfold_13, FOLD_TABLE_SIZE, FoldTable, CaseUnfold_13_Type::from, CaseUnfold_12_Type::from, CaseUnfold_11_Type::from, CaseFold_11_Type::from, numberof, ONIG_IS_NULL, ONIGERR_MEMORY, st_add_direct(), st_data_t, st_init_numtable_with_size(), st_init_table_with_size(), THREAD_ATOMIC_END, THREAD_ATOMIC_START, CaseUnfold_13_Type::to, CaseUnfold_12_Type::to, CaseUnfold_11_Type::to, CaseFold_11_Type::to, type_code2_hash, type_code3_hash, UNFOLD1_TABLE_SIZE, Unfold1Table, UNFOLD2_TABLE_SIZE, Unfold2Table, UNFOLD3_TABLE_SIZE, and Unfold3Table.

Referenced by onigenc_unicode_get_case_fold_codes_by_str(), and onigenc_unicode_mbc_case_fold().

int onigenc_unicode_apply_all_case_fold ( OnigCaseFoldType  flag,
OnigApplyAllCaseFoldFunc  f,
void *  arg,
OnigEncoding enc  ARG_UNUSED 
)

Definition at line 344 of file unicode.c.

References CaseUnfold_11, CaseUnfold_11_Locale, CaseUnfold_12, CaseUnfold_12_Locale, CaseUnfold_13, CodePointList2::code, CodePointList3::code, CaseUnfold_13_Type::from, CaseUnfold_12_Type::from, CaseUnfold_11_Type::from, if(), INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR, CodePointList2::n, CodePointList3::n, numberof, ONIGENC_CASE_FOLD_TURKISH_AZERI, CaseUnfold_13_Type::to, CaseUnfold_12_Type::to, and CaseUnfold_11_Type::to.

int onigenc_unicode_ctype_code_range ( int  ctype,
const OnigCodePoint ranges[] 
)

Definition at line 132 of file unicode.c.

References CODE_RANGES_NUM, CodeRanges, and ONIGERR_TYPE_BUG.

Referenced by get_ctype_code_range(), and onigenc_utf16_32_get_ctype_code_range().

int onigenc_unicode_get_case_fold_codes_by_str ( OnigEncoding  enc,
OnigCaseFoldType  flag,
const OnigUChar p,
const OnigUChar end,
OnigCaseFoldCodeItem  items[] 
)

Definition at line 480 of file unicode.c.

References OnigCaseFoldCodeItem::byte_len, CaseFoldInited, OnigCaseFoldCodeItem::code, OnigCaseFoldCodeItem::code_len, enclen, FoldTable, if(), init_case_fold_table(), INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR, len, onig_st_lookup, ONIGENC_CASE_FOLD_TURKISH_AZERI, ONIGENC_MBC_TO_CODE, st_data_t, Unfold1Table, Unfold2Table, and Unfold3Table.

Referenced by get_case_fold_codes_by_str(), utf16be_get_case_fold_codes_by_str(), utf16le_get_case_fold_codes_by_str(), utf32be_get_case_fold_codes_by_str(), and utf32le_get_case_fold_codes_by_str().

int onigenc_unicode_is_code_ctype ( OnigCodePoint  code,
unsigned int  ctype,
OnigEncoding enc  ARG_UNUSED 
)

Definition at line 113 of file unicode.c.

References CODE_RANGES_NUM, CodeRanges, onig_is_in_code_range(), ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE, ONIGENC_MAX_STD_CTYPE, ONIGERR_TYPE_BUG, UChar, and USE_UNICODE_PROPERTIES.

int onigenc_unicode_mbc_case_fold ( OnigEncoding  enc,
OnigCaseFoldType flag  ARG_UNUSED,
const UChar **  pp,
const UChar *  end,
UChar *  fold 
)

Definition at line 290 of file unicode.c.

References CaseFoldInited, enclen, FoldTable, init_case_fold_table(), INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR, len, onig_st_lookup, ONIGENC_CASE_FOLD_TURKISH_AZERI, ONIGENC_CODE_TO_MBC, ONIGENC_MBC_TO_CODE, st_data_t, and UChar.

Referenced by mbc_case_fold(), utf16be_mbc_case_fold(), utf16le_mbc_case_fold(), utf32be_mbc_case_fold(), and utf32le_mbc_case_fold().

int onigenc_unicode_property_name_to_ctype ( OnigEncoding  enc,
UChar *  name,
UChar *  end 
)

Definition at line 157 of file unicode.c.

References buf, enclen, len, ONIGENC_ASCII_CODE_TO_LOWER_CASE, ONIGENC_MBC_TO_CODE, ONIGERR_INVALID_CHAR_PROPERTY_NAME, PROPERTY_NAME_MAX_SIZE, and UChar.

int onigenc_utf16_32_get_ctype_code_range ( OnigCtype  ctype,
OnigCodePoint sb_out,
const OnigCodePoint ranges[],
struct OnigEncodingTypeST *enc  ARG_UNUSED 
)

Definition at line 144 of file unicode.c.

References onigenc_unicode_ctype_code_range().


Variable Documentation

int CaseFoldInited = 0 [static]

Definition at line 229 of file unicode.c.

Referenced by init_case_fold_table(), onigenc_unicode_get_case_fold_codes_by_str(), and onigenc_unicode_mbc_case_fold().

const unsigned short EncUNICODE_ISO_8859_1_CtypeTable[256] [static]

Definition at line 39 of file unicode.c.

st_table* FoldTable [static]

Definition at line 225 of file unicode.c.

Referenced by init_case_fold_table(), onigenc_unicode_get_case_fold_codes_by_str(), and onigenc_unicode_mbc_case_fold().

struct st_hash_type type_code2_hash [static]

Initial value:

Definition at line 201 of file unicode.c.

Referenced by init_case_fold_table().

struct st_hash_type type_code3_hash [static]

Initial value:

Definition at line 219 of file unicode.c.

Referenced by init_case_fold_table().

st_table* Unfold1Table [static]

Definition at line 226 of file unicode.c.

Referenced by init_case_fold_table(), and onigenc_unicode_get_case_fold_codes_by_str().

st_table* Unfold2Table [static]

Definition at line 227 of file unicode.c.

Referenced by init_case_fold_table(), and onigenc_unicode_get_case_fold_codes_by_str().

st_table* Unfold3Table [static]

Definition at line 228 of file unicode.c.

Referenced by init_case_fold_table(), and onigenc_unicode_get_case_fold_codes_by_str().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7