Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Functions | Variables
regcomp.c File Reference
`#include "regparse.h"`
Include dependency graph for regcomp.c:

Go to the source code of this file.

## Data Structures
struct | MinMaxLen
struct | OptEnv
struct | OptAncInfo
struct | OptExactInfo
struct | OptMapInfo
struct | NodeOptInfo

## Macros
#define | IS_NEED_STR_LEN_OP_EXACT(op)
#define | REPEAT_RANGE_ALLOC 4
#define | QUANTIFIER_EXPAND_LIMIT_SIZE 50
#define | CKN_ON (ckn > 0)
#define | GET_CHAR_LEN_VARLEN -1
#define | GET_CHAR_LEN_TOP_ALT_VARLEN -2
#define | RECURSION_EXIST 1
#define | RECURSION_INFINITE 2
#define | FOUND_CALLED_NODE 1
#define | THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION 8
#define | IN_ALT (1<<0)
#define | IN_NOT (1<<1)
#define | IN_REPEAT (1<<2)
#define | IN_VAR_REPEAT (1<<3)
#define | IN_ROOT (1<<4)
#define | EXPAND_STRING_MAX_LENGTH 100
#define | ALLOWED_TYPE_IN_LB
#define | ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY | ENCLOSE_OPTION )
#define | ALLOWED_ENCLOSE_IN_LB_NOT ENCLOSE_OPTION
#define | ALLOWED_ANCHOR_IN_LB
#define | ALLOWED_ANCHOR_IN_LB_NOT
#define | OPT_EXACT_MAXLEN 24
#define | COMP_EM_BASE 20
#define | MAX_NODE_OPT_INFO_REF_COUNT 5
#define | REGEX_TRANSFER(to, from)
#define | REGEX_CHAIN_HEAD(reg)
#define | COMPILE_INIT_SIZE 20

## Functions
OnigCaseFoldType | onig_get_default_case_fold_flag (void)
int | onig_set_default_case_fold_flag (OnigCaseFoldType case_fold_flag)
static void | swap_node (Node *a, Node *b)
static OnigDistance | distance_add (OnigDistance d1, OnigDistance d2)
static OnigDistance | distance_multiply (OnigDistance d, int m)
static int | bitset_is_empty (BitSetRef bs)
int | onig_bbuf_init (BBuf *buf, OnigDistance size)
static int | unset_addr_list_init (UnsetAddrList *uslist, int size)
static void | unset_addr_list_end (UnsetAddrList *uslist)
static int | unset_addr_list_add (UnsetAddrList *uslist, int offset, struct _Node *node)
static int | add_opcode (regex_t *reg, int opcode)
static int | add_rel_addr (regex_t *reg, int addr)
static int | add_abs_addr (regex_t *reg, int addr)
static int | add_length (regex_t *reg, OnigDistance len)
static int | add_mem_num (regex_t *reg, int num)
static int | add_pointer (regex_t *reg, void *addr)
static int | add_option (regex_t *reg, OnigOptionType option)
static int | add_opcode_rel_addr (regex_t *reg, int opcode, int addr)
static int | add_bytes (regex_t *reg, UChar *bytes, OnigDistance len)
static int | add_bitset (regex_t *reg, BitSetRef bs)
static int | add_opcode_option (regex_t *reg, int opcode, OnigOptionType option)
static int | compile_length_tree (Node *node, regex_t *reg)
static int | compile_tree (Node *node, regex_t *reg)
static int | select_str_opcode (int mb_len, OnigDistance str_len, int ignore_case)
static int | compile_tree_empty_check (Node *node, regex_t *reg, int empty_info)
static int | compile_call (CallNode *node, regex_t *reg)
static int | compile_tree_n_times (Node *node, int n, regex_t *reg)
static int | add_compile_string_length (UChar *s ARG_UNUSED, int mb_len, OnigDistance str_len, regex_t *reg ARG_UNUSED, int ignore_case)
static int | add_compile_string (UChar *s, int mb_len, OnigDistance str_len, regex_t *reg, int ignore_case)
static int | compile_length_string_node (Node *node, regex_t *reg)
static int | compile_length_string_raw_node (StrNode *sn, regex_t *reg)
static int | compile_string_node (Node *node, regex_t *reg)
static int | compile_string_raw_node (StrNode *sn, regex_t *reg)
static int | add_multi_byte_cclass (BBuf *mbuf, regex_t *reg)
static int | compile_length_cclass_node (CClassNode *cc, regex_t *reg)
static int | compile_cclass_node (CClassNode *cc, regex_t *reg)
static int | entry_repeat_range (regex_t *reg, int id, int lower, int upper)
static int | compile_range_repeat_node (QtfrNode *qn, int target_len, int empty_info, regex_t *reg)
static int | is_anychar_star_quantifier (QtfrNode *qn)
static int | compile_length_quantifier_node (QtfrNode *qn, regex_t *reg)
static int | compile_quantifier_node (QtfrNode *qn, regex_t *reg)
static int | compile_length_option_node (EncloseNode *node, regex_t *reg)
static int | compile_option_node (EncloseNode *node, regex_t *reg)
static int | compile_length_enclose_node (EncloseNode *node, regex_t *reg)
static int | get_char_length_tree (Node *node, regex_t *reg, int *len)
static int | compile_enclose_node (EncloseNode *node, regex_t *reg)
static int | compile_length_anchor_node (AnchorNode *node, regex_t *reg)
static int | compile_anchor_node (AnchorNode *node, regex_t *reg)
static int | noname_disable_map (Node **plink, GroupNumRemap *map, int *counter)
static int | renumber_node_backref (Node *node, GroupNumRemap *map)
static int | renumber_by_map (Node *node, GroupNumRemap *map)
static int | numbered_ref_check (Node *node)
static int | disable_noname_group_capture (Node **root, regex_t *reg, ScanEnv *env)
static int | unset_addr_list_fix (UnsetAddrList *uslist, regex_t *reg)
static int | quantifiers_memory_node_info (Node *node)
static int | get_min_match_length (Node *node, OnigDistance *min, ScanEnv *env)
static int | get_max_match_length (Node *node, OnigDistance *max, ScanEnv *env)
static int | get_char_length_tree1 (Node *node, regex_t *reg, int *len, int level)
static int | is_not_included (Node *x, Node *y, regex_t *reg)
static Node * | get_head_value_node (Node *node, int exact, regex_t *reg)
static int | check_type_tree (Node *node, int type_mask, int enclose_mask, int anchor_mask)
static int | subexp_inf_recursive_check (Node *node, ScanEnv *env, int head)
static int | subexp_inf_recursive_check_trav (Node *node, ScanEnv *env)
static int | subexp_recursive_check (Node *node)
static int | subexp_recursive_check_trav (Node *node, ScanEnv *env)
static int | setup_subexp_call (Node *node, ScanEnv *env)
static int | divide_look_behind_alternatives (Node *node)
static int | setup_look_behind (Node *node, regex_t *reg, ScanEnv *env)
static int | next_setup (Node *node, Node *next_node, int in_root, regex_t *reg)
static int | update_string_node_case_fold (regex_t *reg, Node *node)
static int | expand_case_fold_make_rem_string (Node **rnode, UChar *s, UChar *end, regex_t *reg)
static int | expand_case_fold_string_alt (int item_num, OnigCaseFoldCodeItem items[], UChar *p, int slen, UChar *end, regex_t *reg, Node **rnode)
static int | expand_case_fold_string (Node *node, regex_t *reg)
static int | setup_tree (Node *node, regex_t *reg, int state, ScanEnv *env)
static int | set_bm_skip (UChar *s, UChar *end, regex_t *reg, UChar skip[], int **int_skip, int ignore_case)
static int | map_position_value (OnigEncoding enc, int i)
static int | distance_value (MinMaxLen *mm)
static int | comp_distance_value (MinMaxLen *d1, MinMaxLen *d2, int v1, int v2)
static int | is_equal_mml (MinMaxLen *a, MinMaxLen *b)
static void | set_mml (MinMaxLen *mml, OnigDistance min, OnigDistance max)
static void | clear_mml (MinMaxLen *mml)
static void | copy_mml (MinMaxLen *to, MinMaxLen *from)
static void | add_mml (MinMaxLen *to, MinMaxLen *from)
static void | alt_merge_mml (MinMaxLen *to, MinMaxLen *from)
static void | copy_opt_env (OptEnv *to, OptEnv *from)
static void | clear_opt_anc_info (OptAncInfo *anc)
static void | copy_opt_anc_info (OptAncInfo *to, OptAncInfo *from)
static void | concat_opt_anc_info (OptAncInfo *to, OptAncInfo *left, OptAncInfo *right, OnigDistance left_len, OnigDistance right_len)
static int | is_left_anchor (int anc)
static int | is_set_opt_anc_info (OptAncInfo *to, int anc)
static void | add_opt_anc_info (OptAncInfo *to, int anc)
static void | remove_opt_anc_info (OptAncInfo *to, int anc)
static void | alt_merge_opt_anc_info (OptAncInfo *to, OptAncInfo *add)
static int | is_full_opt_exact_info (OptExactInfo *ex)
static void | clear_opt_exact_info (OptExactInfo *ex)
static void | copy_opt_exact_info (OptExactInfo *to, OptExactInfo *from)
static void | concat_opt_exact_info (OptExactInfo *to, OptExactInfo *add, OnigEncoding enc)
static void | concat_opt_exact_info_str (OptExactInfo *to, UChar *s, UChar *end, int raw ARG_UNUSED, OnigEncoding enc)
static void | alt_merge_opt_exact_info (OptExactInfo *to, OptExactInfo *add, OptEnv *env)
static void | select_opt_exact_info (OnigEncoding enc, OptExactInfo *now, OptExactInfo *alt)
static void | clear_opt_map_info (OptMapInfo *map)
static void | copy_opt_map_info (OptMapInfo *to, OptMapInfo *from)
static void | add_char_opt_map_info (OptMapInfo *map, UChar c, OnigEncoding enc)
static int | add_char_amb_opt_map_info (OptMapInfo *map, UChar *p, UChar *end, OnigEncoding enc, OnigCaseFoldType case_fold_flag)
static void | select_opt_map_info (OptMapInfo *now, OptMapInfo *alt)
static int | comp_opt_exact_or_map_info (OptExactInfo *e, OptMapInfo *m)
static void | alt_merge_opt_map_info (OnigEncoding enc, OptMapInfo *to, OptMapInfo *add)
static void | set_bound_node_opt_info (NodeOptInfo *opt, MinMaxLen *mmd)
static void | clear_node_opt_info (NodeOptInfo *opt)
static void | copy_node_opt_info (NodeOptInfo *to, NodeOptInfo *from)
static void | concat_left_node_opt_info (OnigEncoding enc, NodeOptInfo *to, NodeOptInfo *add)
static void | alt_merge_node_opt_info (NodeOptInfo *to, NodeOptInfo *add, OptEnv *env)
static int | optimize_node_left (Node *node, NodeOptInfo *opt, OptEnv *env)
static int | set_optimize_exact_info (regex_t *reg, OptExactInfo *e)
static void | set_optimize_map_info (regex_t *reg, OptMapInfo *m)
static void | set_sub_anchor (regex_t *reg, OptAncInfo *anc)
static int | set_optimize_info_from_tree (Node *node, regex_t *reg, ScanEnv *scan_env)
static void | clear_optimize_info (regex_t *reg)
void | onig_free_body (regex_t *reg)
void | onig_free (regex_t *reg)
size_t | onig_memsize (const regex_t *reg)
size_t | onig_region_memsize (const OnigRegion *regs)
void | onig_transfer (regex_t *to, regex_t *from)
void | onig_chain_link_add (regex_t *to, regex_t *add)
void | onig_chain_reduce (regex_t *reg)
int | onig_compile (regex_t *reg, const UChar *pattern, const UChar *pattern_end, OnigErrorInfo *einfo, const char *sourcefile, int sourceline)
int | onig_reg_init (regex_t *reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType *syntax)
int | onig_new_without_alloc (regex_t *reg, const UChar *pattern, const UChar *pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType *syntax, OnigErrorInfo *einfo)
int | onig_new (regex_t **reg, const UChar *pattern, const UChar *pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType *syntax, OnigErrorInfo *einfo)
int | onig_init (void)
int | onig_end (void)
int | onig_is_in_code_range (const UChar *p, OnigCodePoint code)
int | onig_is_code_in_cc_len (int elen, OnigCodePoint code, CClassNode *cc)
int | onig_is_code_in_cc (OnigEncoding enc, OnigCodePoint code, CClassNode *cc)

## Variables
OnigCaseFoldType | OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN
static unsigned char | PadBuf [WORD_ALIGNMENT_SIZE]
static int | onig_inited = 0

## Macro Definition Documentation

#define ALLOWED_ANCHOR_IN_LB

Value:
( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | \
ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION | ANCHOR_KEEP | \
ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | \
ANCHOR_WORD_BEGIN | ANCHOR_WORD_END )
ANCHOR_WORD_BEGIN
#define ANCHOR_WORD_BEGIN
Definition: regint.h:509
ANCHOR_BEGIN_LINE
#define ANCHOR_BEGIN_LINE
Definition: regint.h:501
ANCHOR_END_LINE
#define ANCHOR_END_LINE
Definition: regint.h:505
ANCHOR_BEGIN_POSITION
#define ANCHOR_BEGIN_POSITION
Definition: regint.h:502
ANCHOR_NOT_WORD_BOUND
#define ANCHOR_NOT_WORD_BOUND
Definition: regint.h:508
ANCHOR_WORD_END
#define ANCHOR_WORD_END
Definition: regint.h:510
ANCHOR_LOOK_BEHIND_NOT
#define ANCHOR_LOOK_BEHIND_NOT
Definition: regint.h:514
ANCHOR_BEGIN_BUF
#define ANCHOR_BEGIN_BUF
Definition: regint.h:500
ANCHOR_LOOK_BEHIND
#define ANCHOR_LOOK_BEHIND
Definition: regint.h:513
ANCHOR_WORD_BOUND
#define ANCHOR_WORD_BOUND
Definition: regint.h:507
ANCHOR_KEEP
#define ANCHOR_KEEP
Definition: regint.h:519

Referenced by setup_tree().

#define ALLOWED_ANCHOR_IN_LB_NOT

Value:
( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | \
ANCHOR_END_LINE | ANCHOR_BEGIN_BUF | ANCHOR_BEGIN_POSITION | ANCHOR_KEEP | \
ANCHOR_WORD_BOUND | ANCHOR_NOT_WORD_BOUND | \
ANCHOR_WORD_BEGIN | ANCHOR_WORD_END )
ANCHOR_WORD_BEGIN
#define ANCHOR_WORD_BEGIN
Definition: regint.h:509
ANCHOR_BEGIN_LINE
#define ANCHOR_BEGIN_LINE
Definition: regint.h:501
ANCHOR_END_LINE
#define ANCHOR_END_LINE
Definition: regint.h:505
ANCHOR_BEGIN_POSITION
#define ANCHOR_BEGIN_POSITION
Definition: regint.h:502
ANCHOR_NOT_WORD_BOUND
#define ANCHOR_NOT_WORD_BOUND
Definition: regint.h:508
ANCHOR_WORD_END
#define ANCHOR_WORD_END
Definition: regint.h:510
ANCHOR_LOOK_BEHIND_NOT
#define ANCHOR_LOOK_BEHIND_NOT
Definition: regint.h:514
ANCHOR_BEGIN_BUF
#define ANCHOR_BEGIN_BUF
Definition: regint.h:500
ANCHOR_LOOK_BEHIND
#define ANCHOR_LOOK_BEHIND
Definition: regint.h:513
ANCHOR_WORD_BOUND
#define ANCHOR_WORD_BOUND
Definition: regint.h:507
ANCHOR_KEEP
#define ANCHOR_KEEP
Definition: regint.h:519

Referenced by setup_tree().

#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY | ENCLOSE_OPTION )

Referenced by setup_tree().

#define ALLOWED_ENCLOSE_IN_LB_NOT ENCLOSE_OPTION

Referenced by setup_tree().

#define ALLOWED_TYPE_IN_LB

Value:
( BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | \
BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL )
BIT_NT_STR
#define BIT_NT_STR
Definition: regparse.h:55
BIT_NT_ENCLOSE
#define BIT_NT_ENCLOSE
Definition: regparse.h:61
BIT_NT_CCLASS
#define BIT_NT_CCLASS
Definition: regparse.h:56
BIT_NT_LIST
#define BIT_NT_LIST
Definition: regparse.h:63
BIT_NT_CTYPE
#define BIT_NT_CTYPE
Definition: regparse.h:57
BIT_NT_CANY
#define BIT_NT_CANY
Definition: regparse.h:58
BIT_NT_ALT
#define BIT_NT_ALT
Definition: regparse.h:64
BIT_NT_CALL
#define BIT_NT_CALL
Definition: regparse.h:65
BIT_NT_QTFR
#define BIT_NT_QTFR
Definition: regparse.h:60
BIT_NT_ANCHOR
#define BIT_NT_ANCHOR
Definition: regparse.h:62

Referenced by setup_tree().

#define CKN_ON (ckn > 0)

Definition at line 736 of file regcomp.c.

#define COMP_EM_BASE 20

Referenced by comp_opt_exact_or_map_info().

#define COMPILE_INIT_SIZE 20

Referenced by onig_compile().

#define EXPAND_STRING_MAX_LENGTH 100

Referenced by setup_tree().

#define FOUND_CALLED_NODE 1

Referenced by subexp_recursive_check_trav().

#define GET_CHAR_LEN_TOP_ALT_VARLEN -2

Definition at line 2384 of file regcomp.c.

Referenced by get_char_length_tree1(), and setup_look_behind().

#define GET_CHAR_LEN_VARLEN -1

Definition at line 2383 of file regcomp.c.

Referenced by get_char_length_tree1(), and setup_look_behind().

#define IN_ALT (1<<0)

Definition at line 3834 of file regcomp.c.

Referenced by setup_tree().

#define IN_NOT (1<<1)

Definition at line 3835 of file regcomp.c.

Referenced by setup_tree().

#define IN_REPEAT (1<<2)

Definition at line 3836 of file regcomp.c.

Referenced by setup_tree().

#define IN_ROOT (1<<4)

Definition at line 3838 of file regcomp.c.

Referenced by onig_compile(), and setup_tree().

#define IN_VAR_REPEAT (1<<3)

Definition at line 3837 of file regcomp.c.

Referenced by setup_tree().

#define IS_NEED_STR_LEN_OP_EXACT | ( |  | op | ) |

Value:
((op) == OP_EXACTN || (op) == OP_EXACTMB2N ||\
(op) == OP_EXACTMB3N || (op) == OP_EXACTMBN || (op) == OP_EXACTN_IC)
OP_EXACTMB2N
Definition: regint.h:535
OP_EXACTN
Definition: regint.h:531
OP_EXACTN_IC
Definition: regint.h:540
OP_EXACTMBN
Definition: regint.h:537
OP_EXACTMB3N
Definition: regint.h:536

Definition at line 319 of file regcomp.c.

Referenced by add_compile_string(), and add_compile_string_length().

#define MAX_NODE_OPT_INFO_REF_COUNT 5

Definition at line 4904 of file regcomp.c.

Referenced by optimize_node_left().

#define OPT_EXACT_MAXLEN 24

Definition at line 4294 of file regcomp.c.

Referenced by concat_opt_exact_info(), concat_opt_exact_info_str(), and is_full_opt_exact_info().

#define QUANTIFIER_EXPAND_LIMIT_SIZE 50

Definition at line 735 of file regcomp.c.

Referenced by compile_length_quantifier_node(), and compile_quantifier_node().

#define RECURSION_EXIST 1

Definition at line 2851 of file regcomp.c.

Referenced by subexp_inf_recursive_check().

#define RECURSION_INFINITE 2

Definition at line 2852 of file regcomp.c.

Referenced by subexp_inf_recursive_check().

#define REGEX_CHAIN_HEAD | ( |  | reg | ) |

Value:
do {\
while (IS_NOT_NULL((reg)->chain)) {\
(reg) = (reg)->chain;\
}\
} while (0)
while
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:5117
IS_NOT_NULL
#define IS_NOT_NULL(p)
Definition: regint.h:279

Definition at line 5630 of file regcomp.c.

Referenced by onig_chain_link_add().

#define REGEX_TRANSFER | ( |  | to,
|  |  | from
| ) |  |

Value:
do {\
(to)->state = ONIG_STATE_MODIFY;\
onig_free_body(to);\
xmemcpy(to, from, sizeof(regex_t));\
xfree(from);\
} while (0)
xfree
#define xfree
re_pattern_buffer
Definition: ripper.y:659
state
int state
Definition: tcltklib.c:1462
ONIG_STATE_MODIFY
#define ONIG_STATE_MODIFY
onig_free_body
void onig_free_body(regex_t *reg)
Definition: regcomp.c:5566
xmemcpy
#define xmemcpy
Definition: regint.h:182

Definition at line 5615 of file regcomp.c.

Referenced by onig_chain_reduce(), and onig_transfer().

#define REPEAT_RANGE_ALLOC 4

Referenced by entry_repeat_range().

#define THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION 8

Referenced by expand_case_fold_string().

## Function Documentation

static int add_abs_addr | ( | regex_t * | reg,
|  | int | addr
| ) |  |
| static

Definition at line 237 of file regcomp.c.

References BBUF_ADD, and SIZE_ABSADDR.

Referenced by compile_call(), and compile_enclose_node().

static int add_bitset | ( | regex_t * | reg,
|  | BitSetRef | bs
| ) |  |
| static

Definition at line 298 of file regcomp.c.

References BBUF_ADD, and SIZE_BITSET.

Referenced by compile_cclass_node().

static int add_bytes | ( | regex_t * | reg,
|  | UChar * | bytes,
|  | OnigDistance | len
| ) |  |
| static

Definition at line 291 of file regcomp.c.

References BBUF_ADD.

Referenced by add_compile_string(), add_multi_byte_cclass(), and compile_quantifier_node().

static int add_char_amb_opt_map_info | ( | OptMapInfo * | map,
|  | UChar * | p,
|  | UChar * | end,
|  | OnigEncoding | enc,
|  | OnigCaseFoldType | case_fold_flag
| ) |  |
| static

Definition at line 4727 of file regcomp.c.

References add_char_opt_map_info(), code, DISABLE_CASE_FOLD_MULTI_CHAR, i, n, ONIGENC_CODE_TO_MBC, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGENC_GET_CASE_FOLD_CODES_BY_STR, ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM, and UChar.

Referenced by optimize_node_left().

static void add_char_opt_map_info | ( | OptMapInfo * | map,
|  | UChar | c,
|  | OnigEncoding | enc
| ) |  |
| static

Definition at line 4718 of file regcomp.c.

References c, OptMapInfo::map, map_position_value(), and OptMapInfo::value.

Referenced by add_char_amb_opt_map_info(), and optimize_node_left().

static int add_compile_string | ( | UChar * | s,
|  | int | mb_len,
|  | OnigDistance | str_len,
|  | regex_t * | reg,
|  | int | ignore_case
| ) |  |
| static

Definition at line 445 of file regcomp.c.

References add_bytes(), add_length(), add_opcode(), IS_NEED_STR_LEN_OP_EXACT, OP_EXACTMBN, OP_EXACTN_IC, and select_str_opcode().

Referenced by compile_string_node(), and compile_string_raw_node().

static int add_compile_string_length | ( | UChar *s | ARG_UNUSED,
|  | int | mb_len,
|  | OnigDistance | str_len,
|  | regex_t *reg | ARG_UNUSED,
|  | int | ignore_case
| ) |  |
| static

Definition at line 428 of file regcomp.c.

References int, IS_NEED_STR_LEN_OP_EXACT, len, OP_EXACTMBN, select_str_opcode(), SIZE_LENGTH, and SIZE_OPCODE.

Referenced by compile_length_string_node(), and compile_length_string_raw_node().

static int add_length | ( | regex_t * | reg,
|  | OnigDistance | len
| ) |  |
| static

Definition at line 246 of file regcomp.c.

References BBUF_ADD, and SIZE_LENGTH.

Referenced by add_compile_string(), add_multi_byte_cclass(), compile_anchor_node(), and compile_tree().

static int add_mem_num | ( | regex_t * | reg,
|  | int | num
| ) |  |
| static

Definition at line 255 of file regcomp.c.

References BBUF_ADD, and SIZE_MEMNUM.

Referenced by compile_enclose_node(), compile_range_repeat_node(), compile_tree(), and compile_tree_empty_check().

static void add_mml | ( | MinMaxLen * | to,
|  | MinMaxLen * | from
| ) |  |
| static

Definition at line 4442 of file regcomp.c.

References distance_add(), MinMaxLen::max, and MinMaxLen::min.

Referenced by concat_left_node_opt_info(), and optimize_node_left().

static int add_multi_byte_cclass | ( | BBuf * | mbuf,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 563 of file regcomp.c.

References add_bytes(), add_length(), BBUF_GET_ADD_ADDRESS, GET_ALIGNMENT_PAD_SIZE, _BBuf::p, p, PadBuf, r, SIZE_LENGTH, UChar, _BBuf::used, and WORD_ALIGNMENT_SIZE.

Referenced by compile_cclass_node().

static int add_opcode | ( | regex_t * | reg,
|  | int | opcode
| ) |  |
| static

Definition at line 210 of file regcomp.c.

References BBUF_ADD1.

Referenced by add_compile_string(), add_opcode_option(), add_opcode_rel_addr(), compile_anchor_node(), compile_call(), compile_cclass_node(), compile_enclose_node(), compile_option_node(), compile_quantifier_node(), compile_range_repeat_node(), compile_tree(), compile_tree_empty_check(), and onig_compile().

static int add_opcode_option | ( | regex_t * | reg,
|  | int | opcode,
|  | OnigOptionType | option
| ) |  |
| static

Definition at line 305 of file regcomp.c.

References add_opcode(), add_option(), and r.

Referenced by compile_option_node().

static int add_opcode_rel_addr | ( | regex_t * | reg,
|  | int | opcode,
|  | int | addr
| ) |  |
| static

Definition at line 280 of file regcomp.c.

References add_opcode(), add_rel_addr(), and r.

Referenced by compile_anchor_node(), compile_enclose_node(), compile_quantifier_node(), and compile_tree().

static void add_opt_anc_info | ( | OptAncInfo * | to,
|  | int | anc
| ) |  |
| static

Definition at line 4520 of file regcomp.c.

References is_left_anchor(), OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

static int add_option | ( | regex_t * | reg,
|  | OnigOptionType | option
| ) |  |
| static

Definition at line 273 of file regcomp.c.

References BBUF_ADD, and SIZE_OPTION.

Referenced by add_opcode_option(), and compile_tree().

static int add_pointer | ( | regex_t * | reg,
|  | void * | addr
| ) |  |
| static

Definition at line 264 of file regcomp.c.

References BBUF_ADD, ptr, and SIZE_POINTER.

Referenced by compile_cclass_node().

static int add_rel_addr | ( | regex_t * | reg,
|  | int | addr
| ) |  |
| static

Definition at line 228 of file regcomp.c.

References BBUF_ADD, and SIZE_RELADDR.

Referenced by add_opcode_rel_addr(), compile_enclose_node(), and compile_range_repeat_node().

static void alt_merge_mml | ( | MinMaxLen * | to,
|  | MinMaxLen * | from
| ) |  |
| static

Definition at line 4458 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by alt_merge_node_opt_info(), and alt_merge_opt_map_info().

static void alt_merge_node_opt_info | ( | NodeOptInfo * | to,
|  | NodeOptInfo * | add,
|  | OptEnv * | env
| ) |  |
| static

Definition at line 4892 of file regcomp.c.

References alt_merge_mml(), alt_merge_opt_anc_info(), alt_merge_opt_exact_info(), alt_merge_opt_map_info(), NodeOptInfo::anc, OptEnv::enc, NodeOptInfo::exb, NodeOptInfo::exm, NodeOptInfo::expr, NodeOptInfo::len, and NodeOptInfo::map.

Referenced by optimize_node_left().

static void alt_merge_opt_anc_info | ( | OptAncInfo * | to,
|  | OptAncInfo * | add
| ) |  |
| static

Definition at line 4538 of file regcomp.c.

References OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by alt_merge_node_opt_info(), alt_merge_opt_exact_info(), and alt_merge_opt_map_info().

static void alt_merge_opt_exact_info | ( | OptExactInfo * | to,
|  | OptExactInfo * | add,
|  | OptEnv * | env
| ) |  |
| static

Definition at line 4614 of file regcomp.c.

References alt_merge_opt_anc_info(), OptExactInfo::anc, clear_opt_exact_info(), OptEnv::enc, enclen, i, OptExactInfo::ignore_case, is_equal_mml(), len, OptExactInfo::len, OptExactInfo::mmd, OptExactInfo::reach_end, return, OptAncInfo::right_anchor, and OptExactInfo::s.

Referenced by alt_merge_node_opt_info().

static void alt_merge_opt_map_info | ( | OnigEncoding | enc,
|  | OptMapInfo * | to,
|  | OptMapInfo * | add
| ) |  |
| static

Definition at line 4781 of file regcomp.c.

References alt_merge_mml(), alt_merge_opt_anc_info(), OptMapInfo::anc, clear_opt_map_info(), i, OptMapInfo::map, map_position_value(), MinMaxLen::max, MinMaxLen::min, OptMapInfo::mmd, ONIG_CHAR_TABLE_SIZE, return, val, and OptMapInfo::value.

Referenced by alt_merge_node_opt_info().

static int bitset_is_empty | ( | BitSetRef | bs | ) |
| static

Definition at line 118 of file regcomp.c.

References BITSET_SIZE, and i.

Referenced by compile_cclass_node(), and compile_length_cclass_node().

static int check_type_tree | ( | Node * | node,
|  | int | type_mask,
|  | int | enclose_mask,
|  | int | anchor_mask
| ) |  |
| static

Definition at line 2801 of file regcomp.c.

References IS_NOT_NULL, NANCHOR, NCAR, NCDR, NENCLOSE, NQTFR, NT_ALT, NT_ANCHOR, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, NTYPE2BIT, r, EncloseNode::target, target, type, and EncloseNode::type.

Referenced by setup_tree().

static void clear_mml | ( | MinMaxLen * | mml | ) |
| static

Definition at line 4429 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by clear_node_opt_info(), clear_opt_exact_info(), and set_optimize_info_from_tree().

static void clear_node_opt_info | ( | NodeOptInfo * | opt | ) |
| static

Definition at line 4816 of file regcomp.c.

References NodeOptInfo::anc, clear_mml(), clear_opt_anc_info(), clear_opt_exact_info(), clear_opt_map_info(), NodeOptInfo::exb, NodeOptInfo::exm, NodeOptInfo::expr, NodeOptInfo::len, and NodeOptInfo::map.

Referenced by optimize_node_left().

static void clear_opt_anc_info | ( | OptAncInfo * | anc | ) |
| static

Definition at line 4471 of file regcomp.c.

References OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by clear_node_opt_info(), clear_opt_exact_info(), and concat_opt_anc_info().

static void clear_opt_exact_info | ( | OptExactInfo * | ex | ) |
| static

Definition at line 4551 of file regcomp.c.

References OptExactInfo::anc, clear_mml(), clear_opt_anc_info(), OptExactInfo::ignore_case, OptExactInfo::len, OptExactInfo::mmd, OptExactInfo::reach_end, and OptExactInfo::s.

Referenced by alt_merge_opt_exact_info(), clear_node_opt_info(), and concat_left_node_opt_info().

static void clear_opt_map_info | ( | OptMapInfo * | map | ) |
| static

Definition at line 4684 of file regcomp.c.

References xmemcpy.

Referenced by alt_merge_opt_map_info(), and clear_node_opt_info().

static void clear_optimize_info | ( | regex_t * | reg | ) |
| static

Definition at line 5396 of file regcomp.c.

References re_pattern_buffer::anchor, re_pattern_buffer::anchor_dmax, re_pattern_buffer::anchor_dmin, re_pattern_buffer::exact, re_pattern_buffer::exact_end, IS_NOT_NULL, NULL, ONIG_OPTIMIZE_NONE, re_pattern_buffer::optimize, re_pattern_buffer::sub_anchor, re_pattern_buffer::threshold_len, UChar, and xfree.

Referenced by onig_compile().

static int comp_distance_value | ( | MinMaxLen * | d1,
|  | MinMaxLen * | d2,
|  | int | v1,
|  | int | v2
| ) |  |
| static

Definition at line 4398 of file regcomp.c.

References distance_value(), and MinMaxLen::min.

Referenced by comp_opt_exact_or_map_info(), select_opt_exact_info(), and select_opt_map_info().

static int comp_opt_exact_or_map_info | ( | OptExactInfo * | e,
|  | OptMapInfo * | m
| ) |  |
| static

Definition at line 4768 of file regcomp.c.

References comp_distance_value(), COMP_EM_BASE, OptExactInfo::ignore_case, OptExactInfo::len, OptExactInfo::mmd, OptMapInfo::mmd, and OptMapInfo::value.

Referenced by set_optimize_info_from_tree().

static int compile_anchor_node | ( | AnchorNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1467 of file regcomp.c.

References add_length(), add_opcode(), add_opcode_rel_addr(), ANCHOR_ANYCHAR_STAR, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_KEEP, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_NOT_WORD_BOUND, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ANCHOR_SEMI_END_BUF, ANCHOR_WORD_BEGIN, ANCHOR_WORD_BOUND, ANCHOR_WORD_END, AnchorNode::ascii_range, AnchorNode::char_len, compile_length_tree(), compile_tree(), get_char_length_tree(), len, n, ONIGERR_INVALID_LOOK_BEHIND_PATTERN, ONIGERR_TYPE_BUG, OP_ASCII_WORD_BEGIN, OP_ASCII_WORD_BOUND, OP_ASCII_WORD_END, OP_BEGIN_BUF, OP_BEGIN_LINE, OP_BEGIN_POS_OR_LINE, OP_BEGIN_POSITION, OP_END_BUF, OP_END_LINE, OP_FAIL_LOOK_BEHIND_NOT, OP_FAIL_POS, OP_KEEP, OP_LOOK_BEHIND, OP_NOT_ASCII_WORD_BOUND, OP_NOT_WORD_BOUND, OP_POP_POS, OP_PUSH_LOOK_BEHIND_NOT, OP_PUSH_POS, OP_PUSH_POS_NOT, OP_SEMI_END_BUF, OP_WORD_BEGIN, OP_WORD_BOUND, OP_WORD_END, r, SIZE_OP_FAIL_LOOK_BEHIND_NOT, SIZE_OP_FAIL_POS, AnchorNode::target, and AnchorNode::type.

Referenced by compile_tree().

static int compile_call | ( | CallNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 401 of file regcomp.c.

References add_abs_addr(), add_opcode(), BBUF_GET_OFFSET_POS, OP_CALL, r, CallNode::target, CallNode::unset_addr_list, and unset_addr_list_add().

Referenced by compile_tree().

static int compile_cclass_node | ( | CClassNode * | cc,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 616 of file regcomp.c.

References add_bitset(), add_multi_byte_cclass(), add_opcode(), add_pointer(), bitset_is_empty(), CClassNode::bs, re_pattern_buffer::enc, IS_NCCLASS_NOT, IS_NCCLASS_SHARE, IS_NULL, CClassNode::mbuf, ONIGENC_MBC_MINLEN, OP_CCLASS, OP_CCLASS_MB, OP_CCLASS_MB_NOT, OP_CCLASS_MIX, OP_CCLASS_MIX_NOT, OP_CCLASS_NODE, OP_CCLASS_NOT, and r.

Referenced by compile_tree().

static int compile_enclose_node | ( | EncloseNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1300 of file regcomp.c.

References add_abs_addr(), add_mem_num(), add_opcode(), add_opcode_rel_addr(), add_rel_addr(), BBUF_GET_OFFSET_POS, BIT_STATUS_AT, re_pattern_buffer::bt_mem_end, re_pattern_buffer::bt_mem_start, EncloseNode::call_addr, compile_length_tree(), compile_option_node(), compile_tree(), compile_tree_n_times(), ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, IS_ENCLOSE_CALLED, IS_ENCLOSE_RECURSION, IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT, len, QtfrNode::lower, NCAR, NCDR, NQTFR, NST_ADDR_FIXED, NT_ALT, NTYPE, NULL, ONIGERR_INVALID_CONDITION_PATTERN, ONIGERR_PARSER_BUG, ONIGERR_TYPE_BUG, OP_CALL, OP_CONDITION, OP_JUMP, OP_MEMORY_END, OP_MEMORY_END_PUSH, OP_MEMORY_END_PUSH_REC, OP_MEMORY_END_REC, OP_MEMORY_START, OP_MEMORY_START_PUSH, OP_POP, OP_POP_STOP_BT, OP_PUSH, OP_PUSH_STOP_BT, OP_RETURN, r, EncloseNode::regnum, SIZE_ABSADDR, SIZE_OP_JUMP, SIZE_OP_MEMORY_END, SIZE_OP_MEMORY_END_PUSH, SIZE_OP_MEMORY_END_PUSH_REC, SIZE_OP_MEMORY_END_REC, SIZE_OP_MEMORY_START_PUSH, SIZE_OP_POP, SIZE_OP_PUSH, SIZE_OP_RETURN, EncloseNode::state, QtfrNode::target, EncloseNode::target, and EncloseNode::type.

Referenced by compile_tree().

static int compile_length_anchor_node | ( | AnchorNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1434 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, compile_length_tree(), len, SIZE_OP_FAIL_LOOK_BEHIND_NOT, SIZE_OP_FAIL_POS, SIZE_OP_LOOK_BEHIND, SIZE_OP_POP_POS, SIZE_OP_PUSH_LOOK_BEHIND_NOT, SIZE_OP_PUSH_POS, SIZE_OP_PUSH_POS_NOT, SIZE_OPCODE, AnchorNode::target, and AnchorNode::type.

Referenced by compile_length_tree().

static int compile_length_cclass_node | ( | CClassNode * | cc,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 586 of file regcomp.c.

References bitset_is_empty(), CClassNode::bs, re_pattern_buffer::enc, IS_NCCLASS_SHARE, IS_NULL, len, CClassNode::mbuf, ONIGENC_MBC_MINLEN, SIZE_BITSET, SIZE_LENGTH, SIZE_OPCODE, SIZE_POINTER, _BBuf::used, and WORD_ALIGNMENT_SIZE.

Referenced by compile_length_tree().

static int compile_length_enclose_node | ( | EncloseNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1214 of file regcomp.c.

References BIT_STATUS_AT, re_pattern_buffer::bt_mem_end, re_pattern_buffer::bt_mem_start, compile_length_option_node(), compile_length_tree(), ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, IS_ENCLOSE_CALLED, IS_ENCLOSE_RECURSION, IS_ENCLOSE_STOP_BT_SIMPLE_REPEAT, len, QtfrNode::lower, NCAR, NCDR, NQTFR, NT_ALT, NTYPE, NULL, ONIGERR_INVALID_CONDITION_PATTERN, ONIGERR_PARSER_BUG, ONIGERR_TYPE_BUG, EncloseNode::regnum, SIZE_OP_CALL, SIZE_OP_CONDITION, SIZE_OP_JUMP, SIZE_OP_MEMORY_END, SIZE_OP_MEMORY_END_PUSH, SIZE_OP_MEMORY_END_PUSH_REC, SIZE_OP_MEMORY_END_REC, SIZE_OP_MEMORY_START, SIZE_OP_MEMORY_START_PUSH, SIZE_OP_POP, SIZE_OP_POP_STOP_BT, SIZE_OP_PUSH, SIZE_OP_PUSH_STOP_BT, SIZE_OP_RETURN, QtfrNode::target, EncloseNode::target, and EncloseNode::type.

Referenced by compile_length_tree().

static int compile_length_option_node | ( | EncloseNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1168 of file regcomp.c.

References compile_length_tree(), IS_DYNAMIC_OPTION, EncloseNode::option, re_pattern_buffer::options, SIZE_OP_FAIL, SIZE_OP_SET_OPTION, SIZE_OP_SET_OPTION_PUSH, and EncloseNode::target.

Referenced by compile_length_enclose_node().

static int compile_length_quantifier_node | ( | QtfrNode * | qn,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 975 of file regcomp.c.

References compile_length_tree(), QtfrNode::greedy, QtfrNode::head_exact, IS_NOT_NULL, QtfrNode::is_refered, IS_REPEAT_INFINITE, len, QtfrNode::lower, QtfrNode::next_head_exact, NT_CANY, NTYPE, QUANTIFIER_EXPAND_LIMIT_SIZE, SIZE_MEMNUM, SIZE_OP_ANYCHAR_STAR, SIZE_OP_ANYCHAR_STAR_PEEK_NEXT, SIZE_OP_JUMP, SIZE_OP_NULL_CHECK_END, SIZE_OP_NULL_CHECK_START, SIZE_OP_PUSH, SIZE_OP_PUSH_IF_PEEK_NEXT, SIZE_OP_PUSH_OR_JUMP_EXACT1, SIZE_OP_REPEAT_INC, SIZE_OPCODE, SIZE_RELADDR, QtfrNode::target, QtfrNode::target_empty_info, and QtfrNode::upper.

Referenced by compile_length_tree().

static int compile_length_string_node | ( | Node * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 467 of file regcomp.c.

References add_compile_string_length(), re_pattern_buffer::enc, enc, enclen, StrNode::end, len, NSTR, NSTRING_IS_AMBIG, p, r, StrNode::s, and UChar.

Referenced by compile_length_tree().

static int compile_length_string_raw_node | ( | StrNode * | sn,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 506 of file regcomp.c.

References add_compile_string_length(), StrNode::end, and StrNode::s.

Referenced by compile_length_tree().

static int compile_length_tree | ( | Node * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1567 of file regcomp.c.

References BRefNode::back_num, BRefNode::back_static, compile_length_anchor_node(), compile_length_cclass_node(), compile_length_enclose_node(), compile_length_quantifier_node(), compile_length_string_node(), compile_length_string_raw_node(), IS_BACKREF_NEST_LEVEL, IS_IGNORECASE, IS_NOT_NULL, len, n, NANCHOR, NBREF, NCAR, NCCLASS, NCDR, NENCLOSE, NQTFR, NSTR, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, ONIGERR_TYPE_BUG, re_pattern_buffer::options, r, SIZE_LENGTH, SIZE_MEMNUM, SIZE_OP_CALL, SIZE_OP_JUMP, SIZE_OP_PUSH, SIZE_OPCODE, SIZE_OPTION, and type.

Referenced by compile_anchor_node(), compile_enclose_node(), compile_length_anchor_node(), compile_length_enclose_node(), compile_length_option_node(), compile_length_quantifier_node(), compile_quantifier_node(), and compile_tree().

static int compile_option_node | ( | EncloseNode * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1188 of file regcomp.c.

References add_opcode(), add_opcode_option(), compile_tree(), IS_DYNAMIC_OPTION, OP_FAIL, OP_SET_OPTION, OP_SET_OPTION_PUSH, EncloseNode::option, re_pattern_buffer::options, r, and EncloseNode::target.

Referenced by compile_enclose_node().

static int compile_quantifier_node | ( | QtfrNode * | qn,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1040 of file regcomp.c.

References add_bytes(), add_opcode(), add_opcode_rel_addr(), compile_length_tree(), compile_range_repeat_node(), compile_tree(), compile_tree_empty_check(), compile_tree_n_times(), QtfrNode::greedy, QtfrNode::head_exact, i, is_anychar_star_quantifier(), IS_MULTILINE, IS_NOT_NULL, QtfrNode::is_refered, IS_REPEAT_INFINITE, QtfrNode::lower, n, QtfrNode::next_head_exact, NSTR, OP_ANYCHAR_ML_STAR, OP_ANYCHAR_ML_STAR_PEEK_NEXT, OP_ANYCHAR_STAR, OP_ANYCHAR_STAR_PEEK_NEXT, OP_JUMP, OP_PUSH, OP_PUSH_IF_PEEK_NEXT, OP_PUSH_OR_JUMP_EXACT1, re_pattern_buffer::options, QUANTIFIER_EXPAND_LIMIT_SIZE, r, SIZE_OP_JUMP, SIZE_OP_NULL_CHECK_END, SIZE_OP_NULL_CHECK_START, SIZE_OP_PUSH, SIZE_OP_PUSH_IF_PEEK_NEXT, SIZE_OP_PUSH_OR_JUMP_EXACT1, QtfrNode::target, QtfrNode::target_empty_info, and QtfrNode::upper.

Referenced by compile_tree().

static int compile_range_repeat_node | ( | QtfrNode * | qn,
|  | int | target_len,
|  | int | empty_info,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 690 of file regcomp.c.

References add_mem_num(), add_opcode(), add_rel_addr(), compile_tree_empty_check(), entry_repeat_range(), QtfrNode::greedy, IS_QUANTIFIER_IN_REPEAT, QtfrNode::lower, re_pattern_buffer::num_call, re_pattern_buffer::num_repeat, OP_REPEAT, OP_REPEAT_INC, OP_REPEAT_INC_NG, OP_REPEAT_INC_NG_SG, OP_REPEAT_INC_SG, OP_REPEAT_NG, r, SIZE_OP_REPEAT_INC, QtfrNode::target, QtfrNode::upper, and USE_SUBEXP_CALL.

Referenced by compile_quantifier_node().

static int compile_string_node | ( | Node * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 515 of file regcomp.c.

References add_compile_string(), re_pattern_buffer::enc, enc, enclen, StrNode::end, end, len, NSTR, NSTRING_IS_AMBIG, p, r, StrNode::s, and UChar.

Referenced by compile_tree().

static int compile_string_raw_node | ( | StrNode * | sn,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 554 of file regcomp.c.

References add_compile_string(), StrNode::end, and StrNode::s.

Referenced by compile_tree().

static int compile_tree | ( | Node * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 1660 of file regcomp.c.

References add_length(), add_mem_num(), add_opcode(), add_opcode_rel_addr(), add_option(), BRefNode::back_num, BRefNode::back_static, BACKREFS_P, compile_anchor_node(), compile_call(), compile_cclass_node(), compile_enclose_node(), compile_length_tree(), compile_quantifier_node(), compile_string_node(), compile_string_raw_node(), i, IS_BACKREF_NEST_LEVEL, IS_IGNORECASE, IS_MULTILINE, IS_NOT_NULL, len, n, NANCHOR, NBREF, NCALL, NCAR, NCCLASS, NCDR, NCTYPE, NENCLOSE, BRefNode::nest_level, NQTFR, NSTR, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, NULL, ONIG_OPTION_IGNORECASE, ONIGENC_CTYPE_WORD, ONIGERR_TYPE_BUG, OP_ANYCHAR, OP_ANYCHAR_ML, OP_ASCII_WORD, OP_BACKREF1, OP_BACKREF2, OP_BACKREF_MULTI, OP_BACKREF_MULTI_IC, OP_BACKREF_WITH_LEVEL, OP_BACKREFN, OP_BACKREFN_IC, OP_JUMP, OP_NOT_ASCII_WORD, OP_NOT_WORD, OP_PUSH, OP_WORD, re_pattern_buffer::options, p, r, SIZE_OP_JUMP, SIZE_OP_PUSH, type, and re_pattern_buffer::used.

Referenced by compile_anchor_node(), compile_enclose_node(), compile_option_node(), compile_quantifier_node(), compile_tree_empty_check(), compile_tree_n_times(), and onig_compile().

static int compile_tree_empty_check | ( | Node * | node,
|  | regex_t * | reg,
|  | int | empty_info
| ) |  |
| static

Definition at line 369 of file regcomp.c.

References add_mem_num(), add_opcode(), compile_tree(), NQ_TARGET_IS_EMPTY, NQ_TARGET_IS_EMPTY_MEM, NQ_TARGET_IS_EMPTY_REC, re_pattern_buffer::num_null_check, OP_NULL_CHECK_END, OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH, OP_NULL_CHECK_START, and r.

Referenced by compile_quantifier_node(), and compile_range_repeat_node().

static int compile_tree_n_times | ( | Node * | node,
|  | int | n,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 416 of file regcomp.c.

References compile_tree(), i, n, and r.

Referenced by compile_enclose_node(), and compile_quantifier_node().

static void concat_left_node_opt_info | ( | OnigEncoding | enc,
|  | NodeOptInfo * | to,
|  | NodeOptInfo * | add
| ) |  |
| static

Definition at line 4833 of file regcomp.c.

References add_mml(), OptExactInfo::anc, OptMapInfo::anc, NodeOptInfo::anc, clear_opt_exact_info(), concat_opt_anc_info(), concat_opt_exact_info(), copy_opt_anc_info(), copy_opt_exact_info(), NodeOptInfo::exb, NodeOptInfo::exm, NodeOptInfo::expr, if(), int, OptAncInfo::left_anchor, OptExactInfo::len, NodeOptInfo::len, NodeOptInfo::map, MinMaxLen::max, OptExactInfo::mmd, OptMapInfo::mmd, OptExactInfo::reach_end, select_opt_exact_info(), select_opt_map_info(), and OptMapInfo::value.

Referenced by optimize_node_left().

static void concat_opt_anc_info | ( | OptAncInfo * | to,
|  | OptAncInfo * | left,
|  | OptAncInfo * | right,
|  | OnigDistance | left_len,
|  | OnigDistance | right_len
| ) |  |
| static

Definition at line 4484 of file regcomp.c.

References clear_opt_anc_info(), OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by concat_left_node_opt_info(), and concat_opt_exact_info().

static void concat_opt_exact_info | ( | OptExactInfo * | to,
|  | OptExactInfo * | add,
|  | OnigEncoding | enc
| ) |  |
| static

Definition at line 4568 of file regcomp.c.

References OptExactInfo::anc, concat_opt_anc_info(), copy_opt_anc_info(), enclen, end, i, OptExactInfo::ignore_case, len, OptExactInfo::len, OPT_EXACT_MAXLEN, p, OptExactInfo::reach_end, return, OptAncInfo::right_anchor, OptExactInfo::s, and UChar.

Referenced by concat_left_node_opt_info(), and optimize_node_left().

static void concat_opt_exact_info_str | ( | OptExactInfo * | to,
|  | UChar * | s,
|  | UChar * | end,
|  | int raw | ARG_UNUSED,
|  | OnigEncoding | enc
| ) |  |
| static

Definition at line 4597 of file regcomp.c.

References enclen, end, i, len, OptExactInfo::len, OPT_EXACT_MAXLEN, p, OptExactInfo::s, and UChar.

Referenced by optimize_node_left().

static void copy_mml | ( | MinMaxLen * | to,
|  | MinMaxLen * | from
| ) |  |
| static

Definition at line 4435 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by set_bound_node_opt_info().

static void copy_node_opt_info | ( | NodeOptInfo * | to,
|  | NodeOptInfo * | from
| ) |  |
| static

Definition at line 4827 of file regcomp.c.

Referenced by optimize_node_left().

static void copy_opt_anc_info | ( | OptAncInfo * | to,
|  | OptAncInfo * | from
| ) |  |
| static

Definition at line 4478 of file regcomp.c.

Referenced by concat_left_node_opt_info(), and concat_opt_exact_info().

static void copy_opt_env | ( | OptEnv * | to,
|  | OptEnv * | from
| ) |  |
| static

Definition at line 4465 of file regcomp.c.

Referenced by optimize_node_left().

static void copy_opt_exact_info | ( | OptExactInfo * | to,
|  | OptExactInfo * | from
| ) |  |
| static

Definition at line 4562 of file regcomp.c.

Referenced by concat_left_node_opt_info(), optimize_node_left(), and select_opt_exact_info().

static void copy_opt_map_info | ( | OptMapInfo * | to,
|  | OptMapInfo * | from
| ) |  |
| static

Definition at line 4712 of file regcomp.c.

Referenced by optimize_node_left(), and select_opt_map_info().

static int disable_noname_group_capture | ( | Node ** | root,
|  | regex_t * | reg,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 2011 of file regcomp.c.

References BIT_STATUS_AT, BIT_STATUS_CLEAR, BIT_STATUS_ON_AT_SIMPLE, ScanEnv::capture_history, CHECK_NULL_RETURN_MEMERR, i, GroupNumRemap::new_val, noname_disable_map(), ScanEnv::num_mem, re_pattern_buffer::num_mem, ScanEnv::num_named, ONIG_MAX_CAPTURE_HISTORY_GROUP, onig_renumber_name_table(), r, renumber_by_map(), SCANENV_MEM_NODES, and xalloca.

Referenced by onig_compile().

static OnigDistance distance_add | ( | OnigDistance | d1,
|  | OnigDistance | d2
| ) |  |
| static

Definition at line 96 of file regcomp.c.

References ONIG_INFINITE_DISTANCE.

Referenced by add_mml(), get_char_length_tree1(), and get_max_match_length().

static OnigDistance distance_multiply | ( | OnigDistance | d,
|  | int | m
| ) |  |
| static

Definition at line 107 of file regcomp.c.

References m, and ONIG_INFINITE_DISTANCE.

Referenced by get_char_length_tree1(), get_max_match_length(), get_min_match_length(), and optimize_node_left().

static int distance_value | ( | MinMaxLen * | mm | ) |
| static

Definition at line 4369 of file regcomp.c.

References d, MinMaxLen::max, MinMaxLen::min, and ONIG_INFINITE_DISTANCE.

Referenced by comp_distance_value().

static int divide_look_behind_alternatives | ( | Node * | node | ) |
| static

Definition at line 3238 of file regcomp.c.

References ANCHOR_LOOK_BEHIND_NOT, CHECK_NULL_RETURN_MEMERR, head, NANCHOR, NCAR, NCDR, NT_LIST, NULL_NODE, onig_node_new_anchor(), SET_NTYPE, swap_node(), AnchorNode::target, and AnchorNode::type.

Referenced by setup_look_behind().

static int entry_repeat_range | ( | regex_t * | reg,
|  | int | id,
|  | int | lower,
|  | int | upper
| ) |  |
| static

Definition at line 659 of file regcomp.c.

References CHECK_NULL_RETURN_MEMERR, id, IS_REPEAT_INFINITE, OnigRepeatRange::lower, n, p, re_pattern_buffer::repeat_range, REPEAT_RANGE_ALLOC, re_pattern_buffer::repeat_range_alloc, OnigRepeatRange::upper, xmalloc, and xrealloc.

Referenced by compile_range_repeat_node().

static int expand_case_fold_make_rem_string | ( | Node ** | rnode,
|  | UChar * | s,
|  | UChar * | end,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 3405 of file regcomp.c.

References IS_NULL, NSTRING_SET_AMBIG, NSTRING_SET_DONT_GET_OPT_INFO, onig_node_free(), onig_node_new_str(), ONIGERR_MEMORY, r, and update_string_node_case_fold().

Referenced by expand_case_fold_string(), and expand_case_fold_string_alt().

static int expand_case_fold_string | ( | Node * | node,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 3545 of file regcomp.c.

References re_pattern_buffer::case_fold_flag, re_pattern_buffer::enc, enclen, StrNode::end, end, err, expand_case_fold_make_rem_string(), expand_case_fold_string_alt(), IS_NOT_NULL, IS_NULL, len, n, NCAR, NSTR, NSTRING_IS_AMBIG, NSTRING_SET_AMBIG, NULL, NULL_NODE, onig_node_free(), onig_node_list_add(), onig_node_new_str(), onig_node_str_cat(), ONIGENC_GET_CASE_FOLD_CODES_BY_STR, ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM, ONIGERR_MEMORY, p, r, StrNode::s, swap_node(), THRESHOLD_CASE_FOLD_ALT_FOR_EXPANSION, UChar, and update_string_node_case_fold().

Referenced by setup_tree().

static int expand_case_fold_string_alt | ( | int | item_num,
|  | OnigCaseFoldCodeItem | items[],
|  | UChar * | p,
|  | int | slen,
|  | UChar * | end,
|  | regex_t * | reg,
|  | Node ** | rnode
| ) |  |
| static

Definition at line 3427 of file regcomp.c.

References buf, OnigCaseFoldCodeItem::byte_len, OnigCaseFoldCodeItem::code, OnigCaseFoldCodeItem::code_len, re_pattern_buffer::enc, expand_case_fold_make_rem_string(), i, IS_NULL, len, NCAR, NCDR, NULL, NULL_NODE, onig_node_free(), onig_node_list_add(), onig_node_new_alt(), onig_node_new_list(), onig_node_new_str(), onig_node_str_cat(), ONIGENC_CODE_TO_MBC, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGERR_MEMORY, q, r, and UChar.

Referenced by expand_case_fold_string().

static int get_char_length_tree | ( | Node * | node,
|  | regex_t * | reg,
|  | int * | len
| ) |  |
| static

Definition at line 2512 of file regcomp.c.

References get_char_length_tree1().

Referenced by compile_anchor_node(), and setup_look_behind().

static int get_char_length_tree1 | ( | Node * | node,
|  | regex_t * | reg,
|  | int * | len,
|  | int | level
| ) |  |
| static

Definition at line 2388 of file regcomp.c.

References EncloseNode::char_len, distance_add(), distance_multiply(), re_pattern_buffer::enc, enclen, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, end, GET_CHAR_LEN_TOP_ALT_VARLEN, GET_CHAR_LEN_VARLEN, int, IS_CALL_RECURSION, IS_ENCLOSE_CLEN_FIXED, IS_NOT_NULL, len, level, QtfrNode::lower, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_CLEN_FIXED, NSTR, NT_ALT, NT_ANCHOR, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, r, s, StrNode::s, SET_ENCLOSE_STATUS, QtfrNode::target, EncloseNode::target, EncloseNode::type, UChar, and QtfrNode::upper.

Referenced by get_char_length_tree().

static Node* get_head_value_node | ( | Node * | node,
|  | int | exact,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 2713 of file regcomp.c.

References ANCHOR_PREC_READ, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, QtfrNode::head_exact, IS_IGNORECASE, IS_NOT_NULL, QtfrNode::lower, n, NANCHOR, NCAR, NENCLOSE, NQTFR, NSTR, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, NULL_NODE, re_pattern_buffer::options, StrNode::s, QtfrNode::target, EncloseNode::target, target, type, and EncloseNode::type.

Referenced by next_setup(), and setup_tree().

static int get_max_match_length | ( | Node * | node,
|  | OnigDistance * | max,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 2266 of file regcomp.c.

References BRefNode::back_num, BACKREFS_P, distance_add(), distance_multiply(), ScanEnv::enc, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, i, IS_CALL_RECURSION, IS_ENCLOSE_MAX_FIXED, IS_NOT_NULL, IS_REPEAT_INFINITE, max(), EncloseNode::max_len, NBREF, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_MAX_FIXED, NST_RECURSION, NSTR, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, ScanEnv::num_mem, ONIG_INFINITE_DISTANCE, ONIGENC_MBC_MAXLEN_DIST, ONIGERR_INVALID_BACKREF, r, StrNode::s, SCANENV_MEM_NODES, SET_ENCLOSE_STATUS, BRefNode::state, QtfrNode::target, EncloseNode::target, target, EncloseNode::type, and QtfrNode::upper.

Referenced by optimize_node_left(), and setup_tree().

static int get_min_match_length | ( | Node * | node,
|  | OnigDistance * | min,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 2142 of file regcomp.c.

References BRefNode::back_num, BACKREFS_P, distance_multiply(), ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, i, IS_CALL_RECURSION, IS_ENCLOSE_MIN_FIXED, IS_NOT_NULL, QtfrNode::lower, min(), EncloseNode::min_len, NBREF, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_MIN_FIXED, NST_RECURSION, NSTR, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, ScanEnv::num_mem, ONIGERR_INVALID_BACKREF, r, StrNode::s, SCANENV_MEM_NODES, SET_ENCLOSE_STATUS, BRefNode::state, QtfrNode::target, EncloseNode::target, target, and EncloseNode::type.

Referenced by optimize_node_left(), setup_tree(), and subexp_inf_recursive_check().

static int is_anychar_star_quantifier | ( | QtfrNode * | qn | ) |
| static

Definition at line 726 of file regcomp.c.

References QtfrNode::greedy, IS_REPEAT_INFINITE, NT_CANY, NTYPE, QtfrNode::target, and QtfrNode::upper.

Referenced by compile_quantifier_node().

static int is_equal_mml | ( | MinMaxLen * | a,
|  | MinMaxLen * | b
| ) |  |
| static

Definition at line 4415 of file regcomp.c.

References MinMaxLen::max, and MinMaxLen::min.

Referenced by alt_merge_opt_exact_info().

static int is_full_opt_exact_info | ( | OptExactInfo * | ex | ) |
| static

Definition at line 4545 of file regcomp.c.

References OptExactInfo::len, and OPT_EXACT_MAXLEN.

Referenced by optimize_node_left().

static int is_left_anchor | ( | int | anc | ) |
| static

Definition at line 4501 of file regcomp.c.

References ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, and ANCHOR_SEMI_END_BUF.

Referenced by add_opt_anc_info(), and remove_opt_anc_info().

static int is_not_included | ( | Node * | x,
|  | Node * | y,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 2519 of file regcomp.c.

References BITSET_AT, CClassNode::bs, code, re_pattern_buffer::enc, StrNode::end, i, IS_CODE_SB_WORD, IS_NCCLASS_NOT, IS_NULL, len, CClassNode::mbuf, NCCLASS, NCTYPE, NSTR, NSTRING_IS_AMBIG, NSTRING_LEN, NT_CCLASS, NT_CTYPE, NT_STR, NTYPE, onig_is_code_in_cc(), ONIGENC_CTYPE_WORD, ONIGENC_IS_CODE_WORD, ONIGENC_IS_MBC_ASCII_WORD, ONIGENC_IS_MBC_WORD, ONIGENC_MBC_MAXLEN, ONIGENC_MBC_TO_CODE, p, q, retry, StrNode::s, SINGLE_BYTE_SIZE, tmp, UChar, and v.

Referenced by next_setup().

static int is_set_opt_anc_info | ( | OptAncInfo * | to,
|  | int | anc
| ) |  |
| static

Definition at line 4512 of file regcomp.c.

References OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

static int map_position_value | ( | OnigEncoding | enc,
|  | int | i
| ) |  |
| static

Definition at line 4345 of file regcomp.c.

References i, and ONIGENC_MBC_MINLEN.

Referenced by add_char_opt_map_info(), alt_merge_opt_map_info(), and select_opt_exact_info().

static int next_setup | ( | Node * | node,
|  | Node * | next_node,
|  | int | in_root,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 3289 of file regcomp.c.

References ANCHOR_ANYCHAR_STAR, CHECK_NULL_RETURN_MEMERR, ENCLOSE_MEMORY, ENCLOSE_STOP_BACKTRACK, get_head_value_node(), QtfrNode::greedy, IS_MULTILINE, IS_NODE_TYPE_SIMPLE, is_not_included(), IS_NOT_NULL, IS_NULL, IS_REPEAT_INFINITE, QtfrNode::lower, n, NCAR, NCDR, NENCLOSE, QtfrNode::next_head_exact, NQTFR, NST_STOP_BT_SIMPLE_REPEAT, NSTR, NT_CANY, NT_ENCLOSE, NT_QTFR, NTYPE, NULL_NODE, onig_node_free(), onig_node_new_anchor(), onig_node_new_enclose(), onig_node_new_list(), ONIGERR_MEMORY, re_pattern_buffer::options, retry, s, SET_ENCLOSE_STATUS, swap_node(), QtfrNode::target, EncloseNode::target, type, EncloseNode::type, and QtfrNode::upper.

Referenced by setup_tree().

static int noname_disable_map | ( | Node ** | plink,
|  | GroupNumRemap * | map,
|  | int * | counter
| ) |  |
| static

Definition at line 1835 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ENCLOSE_MEMORY, IS_ENCLOSE_NAMED_GROUP, IS_NOT_NULL, NANCHOR, NCAR, NCDR, NENCLOSE, GroupNumRemap::new_val, NQTFR, NT_ALT, NT_ANCHOR, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, NULL_NODE, onig_node_free(), onig_reduce_nested_quantifier(), r, EncloseNode::regnum, EncloseNode::target, AnchorNode::target, EncloseNode::type, and AnchorNode::type.

Referenced by disable_noname_group_capture().

static int numbered_ref_check | ( | Node * | node | ) |
| static

Definition at line 1980 of file regcomp.c.

References IS_BACKREF_NAME_REF, IS_NOT_NULL, NBREF, NCAR, NCDR, NENCLOSE, NQTFR, NT_ALT, NT_BREF, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, r, and target.

Referenced by onig_compile().

int onig_bbuf_init | ( | BBuf * | buf,
|  | OnigDistance | size
| ) |  |

Definition at line 148 of file regcomp.c.

References _BBuf::alloc, int, IS_NULL, NULL, ONIGERR_MEMORY, _BBuf::p, UChar, _BBuf::used, and xmalloc.

void onig_chain_link_add | ( | regex_t * | to,
|  | regex_t * | add
| ) |  |

Definition at line 5637 of file regcomp.c.

References add, re_pattern_buffer::chain, REGEX_CHAIN_HEAD, THREAD_ATOMIC_END, and THREAD_ATOMIC_START.

void onig_chain_reduce | ( | regex_t * | reg | ) |

Definition at line 5646 of file regcomp.c.

References re_pattern_buffer::chain, head, IS_NOT_NULL, NULL, ONIG_STATE_MODIFY, REGEX_TRANSFER, and re_pattern_buffer::state.

Referenced by onig_match(), and onig_search_gpos().

int onig_compile | ( | regex_t * | reg,
|  | const UChar * | pattern,
|  | const UChar * | pattern_end,
|  | OnigErrorInfo * | einfo,
|  | const char * | sourcefile,
|  | int | sourceline
| ) |  |

Definition at line 5671 of file regcomp.c.

References add_opcode(), re_pattern_buffer::alloc, ScanEnv::backrefed_mem, BBUF_INIT, BIT_STATUS_AT, BIT_STATUS_ON_ALL, ScanEnv::bt_mem_end, re_pattern_buffer::bt_mem_end, ScanEnv::bt_mem_start, re_pattern_buffer::bt_mem_start, ScanEnv::capture_history, re_pattern_buffer::capture_history, clear_optimize_info(), COMPILE_INIT_SIZE, compile_tree(), disable_noname_group_capture(), ScanEnv::enc, OnigErrorInfo::enc, re_pattern_buffer::enc, end, err, ScanEnv::error, ScanEnv::error_end, i, IN_ROOT, IS_FIND_CONDITION, IS_NOT_NULL, IS_SYNTAX_BV, ScanEnv::mem_nodes_dynamic, NULL, ScanEnv::num_call, re_pattern_buffer::num_call, re_pattern_buffer::num_comb_exp_check, ScanEnv::num_mem, re_pattern_buffer::num_mem, ScanEnv::num_named, re_pattern_buffer::num_null_check, re_pattern_buffer::num_repeat, numbered_ref_check(), ONIG_IS_OPTION_ON, onig_node_free(), ONIG_OPTION_CAPTURE_GROUP, onig_parse_make_tree(), ONIG_STATE_COMPILING, ONIG_STATE_NORMAL, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP, OP_END, re_pattern_buffer::options, OnigErrorInfo::par, OnigErrorInfo::par_end, r, re_pattern_buffer::repeat_range, re_pattern_buffer::repeat_range_alloc, set_optimize_info_from_tree(), setup_subexp_call(), setup_tree(), ScanEnv::sourcefile, ScanEnv::sourceline, re_pattern_buffer::stack_pop_level, STACK_POP_LEVEL_ALL, STACK_POP_LEVEL_FREE, STACK_POP_LEVEL_MEM_START, re_pattern_buffer::state, subexp_inf_recursive_check_trav(), subexp_recursive_check_trav(), ScanEnv::syntax, UChar, ScanEnv::unset_addr_list, unset_addr_list_end(), unset_addr_list_fix(), unset_addr_list_init(), USE_SUBEXP_CALL, re_pattern_buffer::used, and xfree.

Referenced by onig_new(), onig_new_with_source(), and onig_new_without_alloc().

int onig_end | ( | void |  | ) |

Definition at line 6000 of file regcomp.c.

References onig_free_node_list(), onig_free_shared_cclass_table(), THREAD_ATOMIC_END, THREAD_ATOMIC_START, and THREAD_SYSTEM_END.

void onig_free | ( | regex_t * | reg | ) |

Definition at line 5583 of file regcomp.c.

References IS_NOT_NULL, onig_free_body(), and xfree.

Referenced by obj_free(), onig_free_body(), onig_new(), onig_new_with_source(), rb_reg_search(), rb_reg_to_s(), and strscan_do_scan().

void onig_free_body | ( | regex_t * | reg | ) |

Definition at line 5566 of file regcomp.c.

References re_pattern_buffer::chain, re_pattern_buffer::exact, re_pattern_buffer::int_map, re_pattern_buffer::int_map_backward, IS_NOT_NULL, onig_free(), onig_names_free(), re_pattern_buffer::p, re_pattern_buffer::repeat_range, and xfree.

Referenced by onig_free().

OnigCaseFoldType onig_get_default_case_fold_flag | ( | void |  | ) |

Definition at line 36 of file regcomp.c.

References OnigDefaultCaseFoldFlag.

int onig_init | ( | void |  | ) |

Definition at line 5977 of file regcomp.c.

References onigenc_init(), THREAD_ATOMIC_END, THREAD_ATOMIC_START, and THREAD_SYSTEM_INIT.

Referenced by onig_reg_init().

int onig_is_code_in_cc | ( | OnigEncoding | enc,
|  | OnigCodePoint | code,
|  | CClassNode * | cc
| ) |  |

Definition at line 6068 of file regcomp.c.

References len, onig_is_code_in_cc_len(), ONIGENC_CODE_TO_MBCLEN, and ONIGENC_MBC_MINLEN.

Referenced by i_apply_case_fold(), and is_not_included().

int onig_is_code_in_cc_len | ( | int | elen,
|  | OnigCodePoint | code,
|  | CClassNode * | cc
| ) |  |

Definition at line 6045 of file regcomp.c.

References BITSET_AT, CClassNode::bs, IS_NCCLASS_NOT, IS_NULL, CClassNode::mbuf, onig_is_in_code_range(), and _BBuf::p.

Referenced by match_at(), and onig_is_code_in_cc().

int onig_is_in_code_range | ( | const UChar * | p,
|  | OnigCodePoint | code
| ) |  |

Definition at line 6024 of file regcomp.c.

References data, GET_CODE_POINT, and n.

Referenced by match_at(), and onig_is_code_in_cc_len().

size_t onig_memsize | ( | const regex_t * | reg | ) |

Definition at line 5592 of file regcomp.c.

References re_pattern_buffer::alloc, re_pattern_buffer::chain, re_pattern_buffer::exact, re_pattern_buffer::exact_end, if(), re_pattern_buffer::int_map, re_pattern_buffer::int_map_backward, IS_NOT_NULL, IS_NULL, ONIG_CHAR_TABLE_SIZE, re_pattern_buffer::p, re_pattern_buffer::repeat_range, re_pattern_buffer::repeat_range_alloc, and size.

Referenced by memsize_of().

int onig_new | ( | regex_t ** | reg,
|  | const UChar * | pattern,
|  | const UChar * | pattern_end,
|  | OnigOptionType | option,
|  | OnigEncoding | enc,
|  | const OnigSyntaxType * | syntax,
|  | OnigErrorInfo * | einfo
| ) |  |

Definition at line 5954 of file regcomp.c.

References err, IS_NULL, NULL, onig_compile(), onig_free(), onig_reg_init(), ONIGENC_CASE_FOLD_DEFAULT, ONIGERR_MEMORY, r, and xmalloc.

Referenced by rb_reg_prepare_re(), and rb_reg_to_s().

int onig_new_without_alloc | ( | regex_t * | reg,
|  | const UChar * | pattern,
|  | const UChar * | pattern_end,
|  | OnigOptionType | option,
|  | OnigEncoding | enc,
|  | OnigSyntaxType * | syntax,
|  | OnigErrorInfo * | einfo
| ) |  |

Definition at line 5940 of file regcomp.c.

References NULL, onig_compile(), onig_reg_init(), ONIGENC_CASE_FOLD_DEFAULT, and r.

int onig_reg_init | ( | regex_t * | reg,
|  | OnigOptionType | option,
|  | OnigCaseFoldType | case_fold_flag,
|  | OnigEncoding | enc,
|  | const OnigSyntaxType * | syntax
| ) |  |

Definition at line 5894 of file regcomp.c.

References IS_NULL, NULL, onig_init(), ONIG_OPTION_CAPTURE_GROUP, ONIG_OPTION_DONT_CAPTURE_GROUP, ONIG_OPTION_NEGATE_SINGLELINE, ONIG_OPTION_SINGLELINE, ONIG_STATE_MODIFY, ONIGENC_IS_UNDEF, ONIGERR_DEFAULT_ENCODING_IS_NOT_SET, ONIGERR_INVALID_ARGUMENT, ONIGERR_INVALID_COMBINATION_OF_OPTIONS, OnigSyntaxType::options, and UChar.

Referenced by onig_new(), onig_new_with_source(), and onig_new_without_alloc().

size_t onig_region_memsize | ( | const OnigRegion * | regs | ) |

Definition at line 5607 of file regcomp.c.

References re_registers::allocated, re_registers::beg, re_registers::end, IS_NULL, and size.

Referenced by memsize_of(), and strscan_memsize().

int onig_set_default_case_fold_flag | ( | OnigCaseFoldType | case_fold_flag | ) |

Definition at line 42 of file regcomp.c.

References OnigDefaultCaseFoldFlag.

void onig_transfer | ( | regex_t * | to,
|  | regex_t * | from
| ) |  |

Definition at line 5623 of file regcomp.c.

References REGEX_TRANSFER, THREAD_ATOMIC_END, and THREAD_ATOMIC_START.

static int optimize_node_left | ( | Node * | node,
|  | NodeOptInfo * | opt,
|  | OptEnv * | env
| ) |  |
| static

Definition at line 4907 of file regcomp.c.

References add_char_amb_opt_map_info(), add_char_opt_map_info(), add_mml(), add_opt_anc_info(), alt_merge_node_opt_info(), NodeOptInfo::anc, ANCHOR_ANYCHAR_STAR, ANCHOR_ANYCHAR_STAR_MASK, ANCHOR_ANYCHAR_STAR_ML, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ANCHOR_SEMI_END_BUF, BRefNode::back_num, ScanEnv::backrefed_mem, BACKREFS_P, BIT_STATUS_AT, BITSET_AT, CClassNode::bs, OptEnv::case_fold_flag, clear_node_opt_info(), concat_left_node_opt_info(), concat_opt_exact_info(), concat_opt_exact_info_str(), copy_node_opt_info(), copy_opt_env(), copy_opt_exact_info(), copy_opt_map_info(), distance_multiply(), OptEnv::enc, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, NodeOptInfo::exb, NodeOptInfo::exm, NodeOptInfo::expr, get_max_match_length(), get_min_match_length(), QtfrNode::greedy, i, OptExactInfo::ignore_case, IS_CALL_RECURSION, IS_ENCLOSE_MAX_FIXED, IS_ENCLOSE_MIN_FIXED, is_full_opt_exact_info(), IS_MULTILINE, IS_NCCLASS_NOT, IS_NOT_NULL, IS_REPEAT_INFINITE, is_set_opt_anc_info(), OptExactInfo::len, NodeOptInfo::len, QtfrNode::lower, NodeOptInfo::map, max(), MinMaxLen::max, EncloseNode::max_len, MAX_NODE_OPT_INFO_REF_COUNT, CClassNode::mbuf, min(), MinMaxLen::min, EncloseNode::min_len, OptEnv::mmd, n, NANCHOR, NBREF, NCALL, NCAR, NCCLASS, NCDR, NCTYPE, NENCLOSE, NQTFR, NST_RECURSION, NSTR, NSTRING_IS_AMBIG, NSTRING_IS_DONT_GET_OPT_INFO, NSTRING_IS_RAW, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, ONIG_INFINITE_DISTANCE, ONIGENC_CTYPE_WORD, ONIGENC_IS_CODE_WORD, ONIGENC_MBC_MAXLEN_DIST, ONIGENC_MBC_MINLEN, onigenc_strlen(), ONIGERR_TYPE_BUG, EncloseNode::opt_count, EncloseNode::option, OptEnv::options, r, OptExactInfo::reach_end, EncloseNode::regnum, remove_opt_anc_info(), StrNode::s, OptEnv::scan_env, SCANENV_MEM_NODES, set_bound_node_opt_info(), set_mml(), SINGLE_BYTE_SIZE, BRefNode::state, QtfrNode::target, EncloseNode::target, type, EncloseNode::type, UChar, QtfrNode::upper, and OptMapInfo::value.

Referenced by set_optimize_info_from_tree().

static int quantifiers_memory_node_info | ( | Node * | node | ) |
| static

Definition at line 2073 of file regcomp.c.

References ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, IS_CALL_RECURSION, IS_NOT_NULL, NCALL, NCAR, NCDR, NENCLOSE, NQ_TARGET_IS_EMPTY_MEM, NQ_TARGET_IS_EMPTY_REC, NQTFR, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, r, QtfrNode::target, EncloseNode::target, target, EncloseNode::type, QtfrNode::upper, and v.

Referenced by setup_tree().

static void remove_opt_anc_info | ( | OptAncInfo * | to,
|  | int | anc
| ) |  |
| static

Definition at line 4529 of file regcomp.c.

References is_left_anchor(), OptAncInfo::left_anchor, and OptAncInfo::right_anchor.

Referenced by optimize_node_left().

static int renumber_by_map | ( | Node * | node,
|  | GroupNumRemap * | map
| ) |  |
| static

Definition at line 1931 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, ENCLOSE_CONDITION, IS_NOT_NULL, NANCHOR, NCAR, NCDR, NENCLOSE, GroupNumRemap::new_val, NQTFR, NT_ALT, NT_ANCHOR, NT_BREF, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, r, EncloseNode::regnum, renumber_node_backref(), EncloseNode::target, AnchorNode::target, target, EncloseNode::type, and AnchorNode::type.

Referenced by disable_noname_group_capture().

static int renumber_node_backref | ( | Node * | node,
|  | GroupNumRemap * | map
| ) |  |
| static

Definition at line 1903 of file regcomp.c.

References BRefNode::back_dynamic, BRefNode::back_num, BRefNode::back_static, i, IS_BACKREF_NAME_REF, IS_NULL, n, NBREF, GroupNumRemap::new_val, and ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED.

Referenced by renumber_by_map().

static void select_opt_exact_info | ( | OnigEncoding | enc,
|  | OptExactInfo * | now,
|  | OptExactInfo * | alt
| ) |  |
| static

Definition at line 4653 of file regcomp.c.

References comp_distance_value(), copy_opt_exact_info(), OptExactInfo::ignore_case, OptExactInfo::len, map_position_value(), OptExactInfo::mmd, return, and OptExactInfo::s.

Referenced by concat_left_node_opt_info(), and set_optimize_info_from_tree().

static void select_opt_map_info | ( | OptMapInfo * | now,
|  | OptMapInfo * | alt
| ) |  |
| static

Definition at line 4749 of file regcomp.c.

References comp_distance_value(), copy_opt_map_info(), OptMapInfo::mmd, return, and OptMapInfo::value.

Referenced by concat_left_node_opt_info().

static int select_str_opcode | ( | int | mb_len,
|  | OnigDistance | str_len,
|  | int | ignore_case
| ) |  |
| static

Definition at line 324 of file regcomp.c.

References OP_EXACT1, OP_EXACT1_IC, OP_EXACT2, OP_EXACT3, OP_EXACT4, OP_EXACT5, OP_EXACTMB2N, OP_EXACTMB2N1, OP_EXACTMB2N2, OP_EXACTMB2N3, OP_EXACTMB3N, OP_EXACTMBN, OP_EXACTN, and OP_EXACTN_IC.

Referenced by add_compile_string(), and add_compile_string_length().

static int set_bm_skip | ( | UChar * | s,
|  | UChar * | end,
|  | regex_t * | reg,
|  | UChar | skip[],
|  | int ** | int_skip,
|  | int | ignore_case
| ) |  |
| static

Definition at line 4224 of file regcomp.c.

References re_pattern_buffer::case_fold_flag, code, re_pattern_buffer::enc, enclen, i, int, IS_NULL, len, n, ONIG_CHAR_TABLE_SIZE, ONIGENC_CODE_TO_MBC, ONIGENC_GET_CASE_FOLD_CODES_BY_STR, ONIGENC_GET_CASE_FOLD_CODES_MAX_NUM, ONIGENC_MBC_CASE_FOLD_MAXLEN, ONIGERR_MEMORY, p, s, UChar, and xmalloc.

Referenced by set_optimize_exact_info().

static void set_bound_node_opt_info | ( | NodeOptInfo * | opt,
|  | MinMaxLen * | mmd
| ) |  |
| static

Definition at line 4808 of file regcomp.c.

References copy_mml(), NodeOptInfo::exb, NodeOptInfo::expr, NodeOptInfo::map, OptExactInfo::mmd, and OptMapInfo::mmd.

Referenced by optimize_node_left().

static void set_mml | ( | MinMaxLen * | mml,
|  | OnigDistance | min,
|  | OnigDistance | max
| ) |  |
| static

Definition at line 4422 of file regcomp.c.

References max(), MinMaxLen::max, min(), and MinMaxLen::min.

Referenced by optimize_node_left().

static int set_optimize_exact_info | ( | regex_t * | reg,
|  | OptExactInfo * | e
| ) |  |
| static

Definition at line 5256 of file regcomp.c.

References CHECK_NULL_RETURN_MEMERR, re_pattern_buffer::dmax, re_pattern_buffer::dmin, re_pattern_buffer::enc, re_pattern_buffer::exact, re_pattern_buffer::exact_end, OptExactInfo::ignore_case, int, re_pattern_buffer::int_map, OptExactInfo::len, re_pattern_buffer::map, MinMaxLen::max, MinMaxLen::min, OptExactInfo::mmd, ONIG_INFINITE_DISTANCE, ONIG_OPTIMIZE_EXACT, ONIG_OPTIMIZE_EXACT_BM, ONIG_OPTIMIZE_EXACT_BM_IC, ONIG_OPTIMIZE_EXACT_BM_NOT_REV, ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC, ONIG_OPTIMIZE_EXACT_IC, ONIGENC_IS_ALLOWED_REVERSE_MATCH, re_pattern_buffer::optimize, r, OptExactInfo::s, set_bm_skip(), re_pattern_buffer::threshold_len, UChar, xmalloc, and xmemcpy.

Referenced by set_optimize_info_from_tree().

static int set_optimize_info_from_tree | ( | Node * | node,
|  | regex_t * | reg,
|  | ScanEnv * | scan_env
| ) |  |
| static

Definition at line 5340 of file regcomp.c.

References OptExactInfo::anc, OptMapInfo::anc, NodeOptInfo::anc, re_pattern_buffer::anchor, ANCHOR_ANYCHAR_STAR, ANCHOR_ANYCHAR_STAR_ML, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, re_pattern_buffer::anchor_dmax, re_pattern_buffer::anchor_dmin, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_LOOK_BEHIND, ANCHOR_SEMI_END_BUF, re_pattern_buffer::case_fold_flag, OptEnv::case_fold_flag, clear_mml(), comp_opt_exact_or_map_info(), re_pattern_buffer::enc, OptEnv::enc, env, NodeOptInfo::exb, NodeOptInfo::exm, OptAncInfo::left_anchor, OptExactInfo::len, NodeOptInfo::len, NodeOptInfo::map, MinMaxLen::max, MinMaxLen::min, OptEnv::mmd, optimize_node_left(), re_pattern_buffer::options, OptEnv::options, r, OptAncInfo::right_anchor, OptEnv::scan_env, select_opt_exact_info(), set_optimize_exact_info(), set_optimize_map_info(), set_sub_anchor(), re_pattern_buffer::sub_anchor, and OptMapInfo::value.

Referenced by onig_compile().

static void set_optimize_map_info | ( | regex_t * | reg,
|  | OptMapInfo * | m
| ) |  |
| static

Definition at line 5312 of file regcomp.c.

References re_pattern_buffer::dmax, re_pattern_buffer::dmin, i, if(), int, re_pattern_buffer::map, OptMapInfo::map, MinMaxLen::max, MinMaxLen::min, OptMapInfo::mmd, ONIG_CHAR_TABLE_SIZE, ONIG_INFINITE_DISTANCE, ONIG_OPTIMIZE_MAP, re_pattern_buffer::optimize, and re_pattern_buffer::threshold_len.

Referenced by set_optimize_info_from_tree().

static void set_sub_anchor | ( | regex_t * | reg,
|  | OptAncInfo * | anc
| ) |  |
| static

Definition at line 5329 of file regcomp.c.

References ANCHOR_BEGIN_LINE, ANCHOR_END_LINE, OptAncInfo::left_anchor, OptAncInfo::right_anchor, and re_pattern_buffer::sub_anchor.

Referenced by set_optimize_info_from_tree().

static int setup_look_behind | ( | Node * | node,
|  | regex_t * | reg,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 3268 of file regcomp.c.

References AnchorNode::char_len, divide_look_behind_alternatives(), GET_CHAR_LEN_TOP_ALT_VARLEN, GET_CHAR_LEN_VARLEN, get_char_length_tree(), IS_SYNTAX_BV, len, NANCHOR, ONIG_SYN_DIFFERENT_LEN_ALT_LOOK_BEHIND, ONIGERR_INVALID_LOOK_BEHIND_PATTERN, r, ScanEnv::syntax, and AnchorNode::target.

Referenced by setup_tree().

static int setup_subexp_call | ( | Node * | node,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 3119 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, BIT_STATUS_ON_AT, ScanEnv::bt_mem_start, CallNode::group_num, IS_NOT_NULL, IS_NULL, IS_SYNTAX_BV, CallNode::name, CallNode::name_end, NANCHOR, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_CALLED, NT_ALT, NT_ANCHOR, NT_CALL, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, ScanEnv::num_mem, ScanEnv::num_named, ONIG_IS_OPTION_ON, onig_name_to_group_numbers(), ONIG_OPTION_CAPTURE_GROUP, onig_scan_env_set_error_string(), ONIG_SYN_ALLOW_MULTIPLEX_DEFINITION_NAME_CALL, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP, ONIGERR_MULTIPLEX_DEFINITION_NAME_CALL, ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, ONIGERR_UNDEFINED_GROUP_REFERENCE, ONIGERR_UNDEFINED_NAME_REFERENCE, ScanEnv::option, r, ScanEnv::reg, SCANENV_MEM_NODES, SET_ENCLOSE_STATUS, ScanEnv::syntax, CallNode::target, AnchorNode::target, target, type, AnchorNode::type, CallNode::unset_addr_list, and ScanEnv::unset_addr_list.

Referenced by onig_compile().

static int setup_tree | ( | Node * | node,
|  | regex_t * | reg,
|  | int | state,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 3849 of file regcomp.c.

References ALLOWED_ANCHOR_IN_LB, ALLOWED_ANCHOR_IN_LB_NOT, ALLOWED_ENCLOSE_IN_LB, ALLOWED_ENCLOSE_IN_LB_NOT, ALLOWED_TYPE_IN_LB, ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, BRefNode::back_num, ScanEnv::backrefed_mem, BACKREFS_P, BIT_STATUS_ON_AT, ScanEnv::bt_mem_end, ScanEnv::bt_mem_start, check_type_tree(), d, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_OPTION, ENCLOSE_STOP_BACKTRACK, StrNode::end, expand_case_fold_string(), EXPAND_STRING_MAX_LENGTH, StrNode::flag, get_head_value_node(), get_max_match_length(), get_min_match_length(), QtfrNode::greedy, QtfrNode::head_exact, i, IN_ALT, IN_NOT, IN_REPEAT, IN_ROOT, IN_VAR_REPEAT, IS_BACKREF_NEST_LEVEL, IS_ENCLOSE_NAME_REF, IS_IGNORECASE, IS_NODE_TYPE_SIMPLE, IS_NOT_NULL, IS_NULL, IS_REPEAT_INFINITE, IS_SYNTAX_BV, len, QtfrNode::lower, NANCHOR, NBREF, NCAR, NCDR, NENCLOSE, next_setup(), NQ_TARGET_IS_EMPTY, NQTFR, NST_IN_REPEAT, NST_MEM_BACKREFED, NST_STOP_BT_SIMPLE_REPEAT, NSTR, NSTRING_IS_RAW, NSTRING_LEN, NT_ALT, NT_ANCHOR, NT_BREF, NT_CALL, NT_CANY, NT_CCLASS, NT_CTYPE, NT_ENCLOSE, NT_LIST, NT_QTFR, NT_STR, NTYPE, NULL, NULL_NODE, ScanEnv::num_mem, ScanEnv::num_named, ONIG_IS_OPTION_ON, onig_node_free(), onig_node_list_add(), onig_node_new_list(), onig_node_new_str(), onig_node_str_cat(), ONIG_OPTION_CAPTURE_GROUP, ONIG_SYN_CAPTURE_ONLY_NAMED_GROUP, ONIGERR_INVALID_BACKREF, ONIGERR_INVALID_LOOK_BEHIND_PATTERN, ONIGERR_MEMORY, ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED, ScanEnv::option, re_pattern_buffer::options, p, quantifiers_memory_node_info(), r, EncloseNode::regnum, StrNode::s, SCANENV_MEM_NODES, SET_ENCLOSE_STATUS, setup_look_behind(), QtfrNode::state, swap_node(), ScanEnv::syntax, QtfrNode::target, EncloseNode::target, AnchorNode::target, QtfrNode::target_empty_info, type, EncloseNode::type, AnchorNode::type, and QtfrNode::upper.

Referenced by onig_compile().

static int subexp_inf_recursive_check | ( | Node * | node,
|  | ScanEnv * | env,
|  | int | head
| ) |  |
| static

Definition at line 2855 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, CLEAR_ENCLOSE_STATUS, get_min_match_length(), IS_ENCLOSE_MARK1, IS_ENCLOSE_MARK2, IS_NOT_NULL, min(), NANCHOR, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_MARK2, NT_ALT, NT_ANCHOR, NT_CALL, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, r, RECURSION_EXIST, RECURSION_INFINITE, ret, SET_ENCLOSE_STATUS, AnchorNode::target, target, type, and AnchorNode::type.

Referenced by subexp_inf_recursive_check_trav().

static int subexp_inf_recursive_check_trav | ( | Node * | node,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 2939 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, CLEAR_ENCLOSE_STATUS, IS_ENCLOSE_RECURSION, IS_NOT_NULL, NANCHOR, NCAR, NCDR, NENCLOSE, NQTFR, NST_MARK1, NT_ALT, NT_ANCHOR, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, ONIGERR_NEVER_ENDING_RECURSION, r, SET_ENCLOSE_STATUS, subexp_inf_recursive_check(), EncloseNode::target, AnchorNode::target, target, type, and AnchorNode::type.

Referenced by onig_compile().

static int subexp_recursive_check | ( | Node * | node | ) |
| static

Definition at line 2994 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, CLEAR_ENCLOSE_STATUS, IS_ENCLOSE_MARK1, IS_ENCLOSE_MARK2, IS_NOT_NULL, NANCHOR, NCALL, NCAR, NCDR, NENCLOSE, NQTFR, NST_MARK2, NT_ALT, NT_ANCHOR, NT_CALL, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, r, SET_CALL_RECURSION, SET_ENCLOSE_STATUS, AnchorNode::target, target, and AnchorNode::type.

Referenced by subexp_recursive_check_trav().

static int subexp_recursive_check_trav | ( | Node * | node,
|  | ScanEnv * | env
| ) |  |
| static

Definition at line 3050 of file regcomp.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, CLEAR_ENCLOSE_STATUS, FOUND_CALLED_NODE, IS_ENCLOSE_CALLED, IS_ENCLOSE_RECURSION, IS_NOT_NULL, NANCHOR, NCAR, NCDR, NENCLOSE, NQTFR, NST_MARK1, NST_RECURSION, NT_ALT, NT_ANCHOR, NT_ENCLOSE, NT_LIST, NT_QTFR, NTYPE, r, ret, SET_ENCLOSE_STATUS, subexp_recursive_check(), EncloseNode::target, AnchorNode::target, target, type, and AnchorNode::type.

Referenced by onig_compile().

static void swap_node | ( | Node * | a,
|  | Node * | b
| ) |  |
| static

Definition at line 71 of file regcomp.c.

References a, b, StrNode::buf, c, StrNode::capa, StrNode::end, len, NSTR, NT_STR, NTYPE, and StrNode::s.

Referenced by divide_look_behind_alternatives(), expand_case_fold_string(), next_setup(), and setup_tree().

static int unset_addr_list_add | ( | UnsetAddrList * | uslist,
|  | int | offset,
|  | struct _Node * | node
| ) |  |
| static

Definition at line 188 of file regcomp.c.

References UnsetAddrList::alloc, CHECK_NULL_RETURN_MEMERR, UnsetAddrList::num, UnsetAddr::offset, p, size, UnsetAddr::target, UnsetAddrList::us, and xrealloc.

Referenced by compile_call().

static void unset_addr_list_end | ( | UnsetAddrList * | uslist | ) |
| static

Definition at line 181 of file regcomp.c.

References IS_NOT_NULL, UnsetAddrList::us, and xfree.

Referenced by onig_compile().

static int unset_addr_list_fix | ( | UnsetAddrList * | uslist,
|  | regex_t * | reg
| ) |  |
| static

Definition at line 2053 of file regcomp.c.

References BBUF_WRITE, EncloseNode::call_addr, i, IS_ENCLOSE_ADDR_FIXED, NENCLOSE, UnsetAddrList::num, UnsetAddr::offset, ONIGERR_PARSER_BUG, SIZE_ABSADDR, UnsetAddr::target, and UnsetAddrList::us.

Referenced by onig_compile().

static int unset_addr_list_init | ( | UnsetAddrList * | uslist,
|  | int | size
| ) |  |
| static

Definition at line 168 of file regcomp.c.

References UnsetAddrList::alloc, CHECK_NULL_RETURN_MEMERR, UnsetAddrList::num, p, size, UnsetAddrList::us, and xmalloc.

Referenced by onig_compile().

static int update_string_node_case_fold | ( | regex_t * | reg,
|  | Node * | node
| ) |  |
| static

Definition at line 3359 of file regcomp.c.

References buf, re_pattern_buffer::case_fold_flag, CHECK_NULL_RETURN_MEMERR, re_pattern_buffer::enc, StrNode::end, end, i, IS_NULL, len, NSTR, onig_node_str_set(), ONIGENC_MBC_CASE_FOLD, ONIGENC_MBC_CASE_FOLD_MAXLEN, ONIGERR_MEMORY, p, r, StrNode::s, UChar, xfree, xmalloc, and xrealloc.

Referenced by expand_case_fold_make_rem_string(), and expand_case_fold_string().

## Variable Documentation

int onig_inited = 0
| static

Definition at line 5891 of file regcomp.c.

OnigCaseFoldType OnigDefaultCaseFoldFlag = ONIGENC_CASE_FOLD_MIN

Definition at line 33 of file regcomp.c.

unsigned char PadBuf[WORD_ALIGNMENT_SIZE]
| static

Definition at line 50 of file regcomp.c.

Referenced by add_multi_byte_cclass().