Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
regenc.c File Reference
`#include "regint.h"`
Include dependency graph for regenc.c:

Go to the source code of this file.

## Macros
#define | PROP_INIT_SIZE 16

## Functions
int | onigenc_init (void)
OnigEncoding | onigenc_get_default_encoding (void)
int | onigenc_set_default_encoding (OnigEncoding enc)
int | onigenc_mbclen_approximate (const OnigUChar *p, const OnigUChar *e, struct OnigEncodingTypeST *enc)
UChar * | onigenc_get_right_adjust_char_head (OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end)
UChar * | onigenc_get_right_adjust_char_head_with_prev (OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end, const UChar **prev)
UChar * | onigenc_get_prev_char_head (OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end)
UChar * | onigenc_step_back (OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end, int n)
UChar * | onigenc_step (OnigEncoding enc, const UChar *p, const UChar *end, int n)
int | onigenc_strlen (OnigEncoding enc, const UChar *p, const UChar *end)
int | onigenc_strlen_null (OnigEncoding enc, const UChar *s)
int | onigenc_str_bytelen_null (OnigEncoding enc, const UChar *s)
void | onigenc_set_default_caseconv_table (const UChar *table ARG_UNUSED)
UChar * | onigenc_get_left_adjust_char_head (OnigEncoding enc, const UChar *start, const UChar *s, const UChar *end)
int | onigenc_ascii_apply_all_case_fold (OnigCaseFoldType flag ARG_UNUSED, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc ARG_UNUSED)
int | onigenc_ascii_get_case_fold_codes_by_str (OnigCaseFoldType flag ARG_UNUSED, const OnigUChar *p, const OnigUChar *end ARG_UNUSED, OnigCaseFoldCodeItem items[], OnigEncoding enc ARG_UNUSED)
static int | ss_apply_all_case_fold (OnigCaseFoldType flag ARG_UNUSED, OnigApplyAllCaseFoldFunc f, void *arg)
int | onigenc_apply_all_case_fold_with_map (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg)
int | onigenc_get_case_fold_codes_by_str_with_map (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag ARG_UNUSED, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[])
int | onigenc_not_support_get_ctype_code_range (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc)
int | onigenc_is_mbc_newline_0x0a (const UChar *p, const UChar *end, OnigEncoding enc ARG_UNUSED)
int | onigenc_ascii_mbc_case_fold (OnigCaseFoldType flag ARG_UNUSED, const UChar **p, const UChar *end, UChar *lower, OnigEncoding enc ARG_UNUSED)
int | onigenc_single_byte_mbc_enc_len (const UChar *p ARG_UNUSED, const UChar *e ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
OnigCodePoint | onigenc_single_byte_mbc_to_code (const UChar *p, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
int | onigenc_single_byte_code_to_mbclen (OnigCodePoint code ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
int | onigenc_single_byte_code_to_mbc (OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
UChar * | onigenc_single_byte_left_adjust_char_head (const UChar *start ARG_UNUSED, const UChar *s, const UChar *end, OnigEncoding enc ARG_UNUSED)
int | onigenc_always_true_is_allowed_reverse_match (const UChar *s ARG_UNUSED, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
int | onigenc_always_false_is_allowed_reverse_match (const UChar *s ARG_UNUSED, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
int | onigenc_ascii_is_code_ctype (OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
OnigCodePoint | onigenc_mbn_mbc_to_code (OnigEncoding enc, const UChar *p, const UChar *end)
int | onigenc_mbn_mbc_case_fold (OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED, const UChar **pp, const UChar *end ARG_UNUSED, UChar *lower)
int | onigenc_mb2_code_to_mbclen (OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
int | onigenc_mb4_code_to_mbclen (OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
int | onigenc_mb2_code_to_mbc (OnigEncoding enc, OnigCodePoint code, UChar *buf)
int | onigenc_mb4_code_to_mbc (OnigEncoding enc, OnigCodePoint code, UChar *buf)
int | onigenc_minimum_property_name_to_ctype (OnigEncoding enc, UChar *p, UChar *end)
int | onigenc_mb2_is_code_ctype (OnigEncoding enc, OnigCodePoint code, unsigned int ctype)
int | onigenc_mb4_is_code_ctype (OnigEncoding enc, OnigCodePoint code, unsigned int ctype)
int | onigenc_with_ascii_strncmp (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n)
int | onigenc_with_ascii_strnicmp (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n)
static int | resize_property_list (int new_size, const OnigCodePoint ***plist, int *psize)
int | onigenc_property_list_add_property (UChar *name, const OnigCodePoint *prop, hash_table_type **table, const OnigCodePoint ***plist, int *pnum, int *psize)
int | onigenc_property_list_init (int(*f)(void))

## Variables
OnigEncoding | OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT
const UChar | OnigEncAsciiToLowerCaseTable []
const UChar | OnigEncAsciiToUpperCaseTable [256]
const unsigned short | OnigEncAsciiCtypeTable [256]
const UChar | OnigEncISO_8859_1_ToLowerCaseTable [256]
const UChar | OnigEncISO_8859_1_ToUpperCaseTable [256]
const OnigPairCaseFoldCodes | OnigAsciiLowerMap []

## Macro Definition Documentation

#define PROP_INIT_SIZE 16

Referenced by onigenc_property_list_add_property().

## Function Documentation

int onigenc_always_false_is_allowed_reverse_match | ( | const UChar *s | ARG_UNUSED,
|  | const UChar *end | ARG_UNUSED,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 657 of file regenc.c.

References FALSE.

int onigenc_always_true_is_allowed_reverse_match | ( | const UChar *s | ARG_UNUSED,
|  | const UChar *end | ARG_UNUSED,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 650 of file regenc.c.

References TRUE.

int onigenc_apply_all_case_fold_with_map | ( | int | map_size,
|  | const OnigPairCaseFoldCodes | map[],
|  | int | ess_tsett_flag,
|  | OnigCaseFoldType | flag,
|  | OnigApplyAllCaseFoldFunc | f,
|  | void * | arg
| ) |  |

Definition at line 463 of file regenc.c.

References arg, code, OnigPairCaseFoldCodes::from, i, onigenc_ascii_apply_all_case_fold(), r, ss_apply_all_case_fold(), and OnigPairCaseFoldCodes::to.

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

Definition at line 410 of file regenc.c.

References arg, code, OnigPairCaseFoldCodes::from, i, int, r, and OnigPairCaseFoldCodes::to.

Referenced by onigenc_apply_all_case_fold_with_map().

int onigenc_ascii_get_case_fold_codes_by_str | ( | OnigCaseFoldType flag | ARG_UNUSED,
|  | const OnigUChar * | p,
|  | const OnigUChar *end | ARG_UNUSED,
|  | OnigCaseFoldCodeItem | items[],
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 433 of file regenc.c.

References OnigCaseFoldCodeItem::byte_len, OnigCaseFoldCodeItem::code, and OnigCaseFoldCodeItem::code_len.

int onigenc_ascii_is_code_ctype | ( | OnigCodePoint | code,
|  | unsigned int | ctype,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 664 of file regenc.c.

References FALSE, and ONIGENC_IS_ASCII_CODE_CTYPE.

int onigenc_ascii_mbc_case_fold | ( | OnigCaseFoldType flag | ARG_UNUSED,
|  | const UChar ** | p,
|  | const UChar * | end,
|  | UChar * | lower,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 591 of file regenc.c.

References ONIGENC_ASCII_CODE_TO_LOWER_CASE.

int onigenc_get_case_fold_codes_by_str_with_map | ( | int | map_size,
|  | const OnigPairCaseFoldCodes | map[],
|  | int | ess_tsett_flag,
|  | OnigCaseFoldType flag | ARG_UNUSED,
|  | const OnigUChar * | p,
|  | const OnigUChar * | end,
|  | OnigCaseFoldCodeItem | items[]
| ) |  |

Definition at line 491 of file regenc.c.

References OnigCaseFoldCodeItem::byte_len, OnigCaseFoldCodeItem::code, OnigCaseFoldCodeItem::code_len, OnigPairCaseFoldCodes::from, i, and OnigPairCaseFoldCodes::to.

OnigEncoding onigenc_get_default_encoding | ( | void |  | ) |

Definition at line 42 of file regenc.c.

References OnigEncDefaultCharEncoding.

UChar* onigenc_get_left_adjust_char_head | ( | OnigEncoding | enc,
|  | const UChar * | start,
|  | const UChar * | s,
|  | const UChar * | end
| ) |  |

Definition at line 375 of file regenc.c.

References ONIGENC_LEFT_ADJUST_CHAR_HEAD.

UChar* onigenc_get_prev_char_head | ( | OnigEncoding | enc,
|  | const UChar * | start,
|  | const UChar * | s,
|  | const UChar * | end
| ) |  |

Definition at line 92 of file regenc.c.

References NULL, ONIGENC_LEFT_ADJUST_CHAR_HEAD, and UChar.

Referenced by backward_search_range(), forward_search_range(), is_mbc_newline_ex(), map_search_backward(), match_at(), onig_match(), onig_search_gpos(), slow_search_backward(), slow_search_backward_ic(), and str_node_split_last_char().

UChar* onigenc_get_right_adjust_char_head | ( | OnigEncoding | enc,
|  | const UChar * | start,
|  | const UChar * | s,
|  | const UChar * | end
| ) |  |

Definition at line 66 of file regenc.c.

References enclen, ONIGENC_LEFT_ADJUST_CHAR_HEAD, p, and UChar.

Referenced by backward_search_range(), onig_search_gpos(), and rb_reg_adjust_startpos().

UChar* onigenc_get_right_adjust_char_head_with_prev | ( | OnigEncoding | enc,
|  | const UChar * | start,
|  | const UChar * | s,
|  | const UChar * | end,
|  | const UChar ** | prev
| ) |  |

Definition at line 76 of file regenc.c.

References enclen, NULL, ONIGENC_LEFT_ADJUST_CHAR_HEAD, p, and UChar.

Referenced by forward_search_range().

int onigenc_init | ( | void |  | ) |

Definition at line 36 of file regenc.c.

Referenced by onig_init().

int onigenc_is_mbc_newline_0x0a | ( | const UChar * | p,
|  | const UChar * | end,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 581 of file regenc.c.

int onigenc_mb2_code_to_mbc | ( | OnigEncoding | enc,
|  | OnigCodePoint | code,
|  | UChar * | buf
| ) |  |

Definition at line 751 of file regenc.c.

References buf, enclen, ONIGERR_INVALID_CODE_POINT_VALUE, and UChar.

int onigenc_mb2_code_to_mbclen | ( | OnigCodePoint | code,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 734 of file regenc.c.

References ONIGERR_TOO_BIG_WIDE_CHAR_VALUE.

int onigenc_mb2_is_code_ctype | ( | OnigEncoding | enc,
|  | OnigCodePoint | code,
|  | unsigned int | ctype
| ) |  |

Definition at line 824 of file regenc.c.

References CTYPE_IS_WORD_GRAPH_PRINT, FALSE, ONIGENC_CODE_TO_MBCLEN, ONIGENC_IS_ASCII_CODE_CTYPE, and TRUE.

int onigenc_mb4_code_to_mbc | ( | OnigEncoding | enc,
|  | OnigCodePoint | code,
|  | UChar * | buf
| ) |  |

Definition at line 768 of file regenc.c.

References buf, enclen, ONIGERR_INVALID_CODE_POINT_VALUE, and UChar.

int onigenc_mb4_code_to_mbclen | ( | OnigCodePoint | code,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 742 of file regenc.c.

int onigenc_mb4_is_code_ctype | ( | OnigEncoding | enc,
|  | OnigCodePoint | code,
|  | unsigned int | ctype
| ) |  |

Definition at line 839 of file regenc.c.

References CTYPE_IS_WORD_GRAPH_PRINT, FALSE, ONIGENC_CODE_TO_MBCLEN, ONIGENC_IS_ASCII_CODE_CTYPE, and TRUE.

int onigenc_mbclen_approximate | ( | const OnigUChar * | p,
|  | const OnigUChar * | e,
|  | struct OnigEncodingTypeST * | enc
| ) |  |

Definition at line 55 of file regenc.c.

References ONIGENC_MBCLEN_CHARFOUND_LEN, ONIGENC_MBCLEN_CHARFOUND_P, ONIGENC_MBCLEN_NEEDMORE_LEN, ONIGENC_MBCLEN_NEEDMORE_P, ONIGENC_PRECISE_MBC_ENC_LEN, p, and ret.

int onigenc_mbn_mbc_case_fold | ( | OnigEncoding | enc,
|  | OnigCaseFoldType flag | ARG_UNUSED,
|  | const UChar ** | pp,
|  | const UChar *end | ARG_UNUSED,
|  | UChar * | lower
| ) |  |

Definition at line 692 of file regenc.c.

References enclen, end, i, len, ONIGENC_ASCII_CODE_TO_LOWER_CASE, ONIGENC_IS_MBC_ASCII, p, and UChar.

OnigCodePoint onigenc_mbn_mbc_to_code | ( | OnigEncoding | enc,
|  | const UChar * | p,
|  | const UChar * | end
| ) |  |

Definition at line 674 of file regenc.c.

References c, enclen, i, len, and n.

int onigenc_minimum_property_name_to_ctype | ( | OnigEncoding | enc,
|  | UChar * | p,
|  | UChar * | end
| ) |  |

Definition at line 791 of file regenc.c.

References PosixBracketEntryType::ctype, PosixBracketEntryType::len, len, PosixBracketEntryType::name, ONIGENC_CTYPE_ALNUM, ONIGENC_CTYPE_ALPHA, ONIGENC_CTYPE_ASCII, ONIGENC_CTYPE_BLANK, ONIGENC_CTYPE_CNTRL, ONIGENC_CTYPE_DIGIT, ONIGENC_CTYPE_GRAPH, ONIGENC_CTYPE_LOWER, ONIGENC_CTYPE_PRINT, ONIGENC_CTYPE_PUNCT, ONIGENC_CTYPE_SPACE, ONIGENC_CTYPE_UPPER, ONIGENC_CTYPE_WORD, ONIGENC_CTYPE_XDIGIT, onigenc_strlen(), onigenc_with_ascii_strnicmp(), ONIGERR_INVALID_CHAR_PROPERTY_NAME, and PosixBracketEntryInit.

int onigenc_not_support_get_ctype_code_range | ( | OnigCtype | ctype,
|  | OnigCodePoint * | sb_out,
|  | const OnigCodePoint * | ranges[],
|  | OnigEncoding | enc
| ) |  |

Definition at line 573 of file regenc.c.

References ONIG_NO_SUPPORT_CONFIG.

int onigenc_property_list_add_property | ( | UChar * | name,
|  | const OnigCodePoint * | prop,
|  | hash_table_type ** | table,
|  | const OnigCodePoint *** | plist,
|  | int * | pnum,
|  | int * | psize
| ) |  |

Definition at line 917 of file regenc.c.

References new_size(), ONIG_IS_NULL, onig_st_init_strend_table_with_size(), onig_st_insert_strend(), ONIGENC_MAX_STD_CTYPE, ONIGERR_MEMORY, PROP_INIT_SIZE, r, resize_property_list(), and strlen().

int onigenc_property_list_init | ( | int(*)(void) | f | ) |

Definition at line 945 of file regenc.c.

References f, r, THREAD_ATOMIC_END, and THREAD_ATOMIC_START.

void onigenc_set_default_caseconv_table | ( | const UChar *table | ARG_UNUSED | ) |

Definition at line 368 of file regenc.c.

Referenced by Init_Regexp().

int onigenc_set_default_encoding | ( | OnigEncoding | enc | ) |

Definition at line 48 of file regenc.c.

References enc.

Referenced by Init_Regexp().

int onigenc_single_byte_code_to_mbc | ( | OnigCodePoint | code,
|  | UChar * | buf,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 633 of file regenc.c.

References rb_eRangeError, rb_raise(), and UChar.

int onigenc_single_byte_code_to_mbclen | ( | OnigCodePoint code | ARG_UNUSED,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 627 of file regenc.c.

UChar* onigenc_single_byte_left_adjust_char_head | ( | const UChar *start | ARG_UNUSED,
|  | const UChar * | s,
|  | const UChar * | end,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 642 of file regenc.c.

References s, and UChar.

int onigenc_single_byte_mbc_enc_len | ( | const UChar *p | ARG_UNUSED,
|  | const UChar *e | ARG_UNUSED,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 613 of file regenc.c.

OnigCodePoint onigenc_single_byte_mbc_to_code | ( | const UChar * | p,
|  | const UChar *end | ARG_UNUSED,
|  | OnigEncoding enc | ARG_UNUSED
| ) |  |

Definition at line 620 of file regenc.c.

UChar* onigenc_step | ( | OnigEncoding | enc,
|  | const UChar * | p,
|  | const UChar * | end,
|  | int | n
| ) |  |

Definition at line 113 of file regenc.c.

References NULL, ONIGENC_MBC_ENC_LEN, q, and UChar.

Referenced by parse_posix_bracket().

UChar* onigenc_step_back | ( | OnigEncoding | enc,
|  | const UChar * | start,
|  | const UChar * | s,
|  | const UChar * | end,
|  | int | n
| ) |  |

Definition at line 101 of file regenc.c.

References NULL, ONIG_IS_NOT_NULL, ONIGENC_LEFT_ADJUST_CHAR_HEAD, s, and UChar.

int onigenc_str_bytelen_null | ( | OnigEncoding | enc,
|  | const UChar * | s
| ) |  |

Definition at line 163 of file regenc.c.

References e, len, ONIGENC_MBC_ENC_LEN, ONIGENC_MBC_MAXLEN, ONIGENC_MBC_MINLEN, p, q, and UChar.

Referenced by switch().

int onigenc_strlen | ( | OnigEncoding | enc,
|  | const UChar * | p,
|  | const UChar * | end
| ) |  |

Definition at line 123 of file regenc.c.

References n, ONIGENC_MBC_ENC_LEN, q, and UChar.

Referenced by onigenc_minimum_property_name_to_ctype(), optimize_node_left(), and parse_posix_bracket().

int onigenc_strlen_null | ( | OnigEncoding | enc,
|  | const UChar * | s
| ) |  |

Definition at line 136 of file regenc.c.

References e, len, n, ONIGENC_MBC_ENC_LEN, ONIGENC_MBC_MAXLEN, ONIGENC_MBC_MINLEN, p, q, and UChar.

int onigenc_with_ascii_strncmp | ( | OnigEncoding | enc,
|  | const UChar * | p,
|  | const UChar * | end,
|  | const UChar * | sascii,
|  | int | n
| ) |  |

Definition at line 854 of file regenc.c.

References c, enclen, int, and ONIGENC_MBC_TO_CODE.

Referenced by parse_posix_bracket().

int onigenc_with_ascii_strnicmp | ( | OnigEncoding | enc,
|  | const UChar * | p,
|  | const UChar * | end,
|  | const UChar * | sascii,
|  | int | n
| ) |  |

Definition at line 873 of file regenc.c.

References c, enclen, int, ONIGENC_ASCII_CODE_TO_LOWER_CASE, ONIGENC_IS_ASCII_CODE, and ONIGENC_MBC_TO_CODE.

Referenced by onigenc_minimum_property_name_to_ctype().

static int resize_property_list | ( | int | new_size,
|  | const OnigCodePoint *** | plist,
|  | int * | psize
| ) |  |
| static

Definition at line 895 of file regenc.c.

References IS_NULL, list, new_size(), ONIGERR_MEMORY, size, xmalloc, and xrealloc.

Referenced by onigenc_property_list_add_property().

static int ss_apply_all_case_fold | ( | OnigCaseFoldType flag | ARG_UNUSED,
|  | OnigApplyAllCaseFoldFunc | f,
|  | void * | arg
| ) |  |
| static

Definition at line 454 of file regenc.c.

Referenced by onigenc_apply_all_case_fold_with_map().

## Variable Documentation

const OnigPairCaseFoldCodes OnigAsciiLowerMap[]

Initial value:
= {
{ 0x41, 0x61 },
{ 0x42, 0x62 },
{ 0x43, 0x63 },
{ 0x44, 0x64 },
{ 0x45, 0x65 },
{ 0x46, 0x66 },
{ 0x47, 0x67 },
{ 0x48, 0x68 },
{ 0x49, 0x69 },
{ 0x4a, 0x6a },
{ 0x4b, 0x6b },
{ 0x4c, 0x6c },
{ 0x4d, 0x6d },
{ 0x4e, 0x6e },
{ 0x4f, 0x6f },
{ 0x50, 0x70 },
{ 0x51, 0x71 },
{ 0x52, 0x72 },
{ 0x53, 0x73 },
{ 0x54, 0x74 },
{ 0x55, 0x75 },
{ 0x56, 0x76 },
{ 0x57, 0x77 },
{ 0x58, 0x78 },
{ 0x59, 0x79 },
{ 0x5a, 0x7a }
}

Definition at line 380 of file regenc.c.

const unsigned short OnigEncAsciiCtypeTable[256]

Definition at line 260 of file regenc.c.

const UChar OnigEncAsciiToLowerCaseTable[]

Definition at line 188 of file regenc.c.

const UChar OnigEncAsciiToUpperCaseTable[256]

Definition at line 224 of file regenc.c.

OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT

Definition at line 33 of file regenc.c.

const UChar OnigEncISO_8859_1_ToLowerCaseTable[256]

Definition at line 295 of file regenc.c.

const UChar OnigEncISO_8859_1_ToUpperCaseTable[256]

Definition at line 331 of file regenc.c.