Ruby  2.0.0p451(2014-02-24revision45167)
Data Structures | Macros | Typedefs | Functions | Variables
regexec.c File Reference
#include "regint.h"
Include dependency graph for regexec.c:

Go to the source code of this file.

Data Structures

struct  posix_regmatch_t
 

Macros

#define ONIGENC_IS_MBC_CRNL(enc, p, end)
 
#define ONIGENC_IS_MBC_NEWLINE_EX(enc, p, start, end, option, check_prev)   is_mbc_newline_ex((enc),(p),(start),(end),(option),(check_prev))
 
#define RREGC_SIZE   (sizeof(int) * from->num_regs)
 
#define INVALID_STACK_INDEX   -1
 stack More...
 
#define STK_ALT   0x0001
 
#define STK_LOOK_BEHIND_NOT   0x0002
 
#define STK_POS_NOT   0x0003
 
#define STK_MEM_START   0x0100
 
#define STK_MEM_END   0x8200
 
#define STK_REPEAT_INC   0x0300
 
#define STK_STATE_CHECK_MARK   0x1000
 
#define STK_NULL_CHECK_START   0x3000
 
#define STK_NULL_CHECK_END   0x5000 /* for recursive call */
 
#define STK_MEM_END_MARK   0x8400
 
#define STK_POS   0x0500 /* used when POP-POS */
 
#define STK_STOP_BT   0x0600 /* mark for "(?>...)" */
 
#define STK_REPEAT   0x0700
 
#define STK_CALL_FRAME   0x0800
 
#define STK_RETURN   0x0900
 
#define STK_VOID   0x0a00 /* for fill a blank */
 
#define STK_MASK_POP_USED   0x00ff
 
#define STK_MASK_TO_VOID_TARGET   0x10ff
 
#define STK_MASK_MEM_END_OR_MARK   0x8000 /* MEM_END or MEM_END_MARK */
 
#define MATCH_ARG_INIT(msa, arg_option, arg_region, arg_start, arg_gpos)
 
#define MATCH_ARG_FREE(msa)   if ((msa).stack_p) xfree((msa).stack_p)
 
#define STACK_INIT(alloc_addr, ptr_num, stack_num)
 
#define STACK_SAVE
 
#define STACK_ENSURE(n)
 
#define STACK_AT(index)   (stk_base + (index))
 
#define GET_STACK_INDEX(stk)   ((stk) - stk_base)
 
#define STACK_PUSH_TYPE(stack_type)
 
#define IS_TO_VOID_TARGET(stk)   (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)
 
#define ELSE_IF_STATE_CHECK_MARK(stk)
 
#define STACK_PUSH(stack_type, pat, s, sprev, keep)
 
#define STACK_PUSH_ENSURED(stack_type, pat)
 
#define STACK_PUSH_ALT(pat, s, sprev, keep)   STACK_PUSH(STK_ALT,pat,s,sprev,keep)
 
#define STACK_PUSH_POS(s, sprev, keep)   STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev,keep)
 
#define STACK_PUSH_POS_NOT(pat, s, sprev, keep)   STACK_PUSH(STK_POS_NOT,pat,s,sprev,keep)
 
#define STACK_PUSH_STOP_BT   STACK_PUSH_TYPE(STK_STOP_BT)
 
#define STACK_PUSH_LOOK_BEHIND_NOT(pat, s, sprev, keep)   STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev,keep)
 
#define STACK_PUSH_REPEAT(id, pat)
 
#define STACK_PUSH_REPEAT_INC(sindex)
 
#define STACK_PUSH_MEM_START(mnum, s)
 
#define STACK_PUSH_MEM_END(mnum, s)
 
#define STACK_PUSH_MEM_END_MARK(mnum)
 
#define STACK_GET_MEM_START(mnum, k)
 
#define STACK_GET_MEM_RANGE(k, mnum, start, end)
 
#define STACK_PUSH_NULL_CHECK_START(cnum, s)
 
#define STACK_PUSH_NULL_CHECK_END(cnum)
 
#define STACK_PUSH_CALL_FRAME(pat)
 
#define STACK_PUSH_RETURN
 
#define STACK_BASE_CHECK(p, at)
 
#define STACK_POP_ONE
 
#define STACK_POP
 
#define STACK_POP_TIL_POS_NOT
 
#define STACK_POP_TIL_LOOK_BEHIND_NOT
 
#define STACK_POS_END(k)
 
#define STACK_STOP_BT_END
 
#define STACK_NULL_CHECK(isnull, id, s)
 
#define STACK_NULL_CHECK_REC(isnull, id, s)
 
#define STACK_NULL_CHECK_MEMST(isnull, id, s, reg)
 
#define STACK_NULL_CHECK_MEMST_REC(isnull, id, s, reg)
 
#define STACK_GET_REPEAT(id, k)
 
#define STACK_RETURN(addr)
 
#define STRING_CMP(s1, s2, len)
 
#define STRING_CMP_IC(case_fold_flag, s1, ps2, len, text_end)
 
#define STRING_CMP_VALUE(s1, s2, len, is_fail)
 
#define STRING_CMP_VALUE_IC(case_fold_flag, s1, ps2, len, text_end, is_fail)
 
#define IS_EMPTY_STR   (str == end)
 
#define ON_STR_BEGIN(s)   ((s) == str)
 
#define ON_STR_END(s)   ((s) == end)
 
#define DATA_ENSURE_CHECK1   (s < end)
 
#define DATA_ENSURE_CHECK(n)   (s + (n) <= end)
 
#define DATA_ENSURE(n)   if (s + (n) > end) goto fail
 
#define STACK_INC   stk++
 
#define MOP_IN(opcode)
 
#define MOP_OUT
 
#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD   100
 
#define MATCH_AND_RETURN_CHECK(none)
 

Typedefs

typedef int regoff_t
 

Functions

static int is_mbc_newline_ex (OnigEncoding enc, const UChar *p, const UChar *start, const UChar *end, OnigOptionType option, int check_prev)
 
void onig_region_clear (OnigRegion *region)
 
int onig_region_resize (OnigRegion *region, int n)
 
static int onig_region_resize_clear (OnigRegion *region, int n)
 
int onig_region_set (OnigRegion *region, int at, int beg, int end)
 
void onig_region_init (OnigRegion *region)
 
OnigRegiononig_region_new (void)
 
void onig_region_free (OnigRegion *r, int free_self)
 
void onig_region_copy (OnigRegion *to, OnigRegion *from)
 
unsigned int onig_get_match_stack_limit_size (void)
 
int onig_set_match_stack_limit_size (unsigned int size)
 
static int stack_double (OnigStackType **arg_stk_base, OnigStackType **arg_stk_end, OnigStackType **arg_stk, OnigStackType *stk_alloc, OnigMatchArg *msa)
 
static int string_cmp_ic (OnigEncoding enc, int case_fold_flag, UChar *s1, UChar **ps2, OnigDistance mblen, const UChar *text_end)
 
static int mem_is_in_memp (int mem, int num, UChar *memp)
 
static int backref_match_at_nested_level (regex_t *reg, OnigStackType *top, OnigStackType *stk_base, int ignore_case, int case_fold_flag, int nest, int mem_num, UChar *memp, UChar **s, const UChar *send)
 
void onig_print_compiled_byte_code (FILE *f, UChar *bp, UChar *bpend, UChar **nextp, OnigEncoding enc)
 
static OnigPosition match_at (regex_t *reg, const UChar *str, const UChar *end, const UChar *sstart, UChar *sprev, OnigMatchArg *msa)
 
static UCharslow_search (OnigEncoding enc, UChar *target, UChar *target_end, const UChar *text, const UChar *text_end, UChar *text_range)
 
static int str_lower_case_match (OnigEncoding enc, int case_fold_flag, const UChar *t, const UChar *tend, const UChar *p, const UChar *end)
 
static UCharslow_search_ic (OnigEncoding enc, int case_fold_flag, UChar *target, UChar *target_end, const UChar *text, const UChar *text_end, UChar *text_range)
 
static UCharslow_search_backward (OnigEncoding enc, UChar *target, UChar *target_end, const UChar *text, const UChar *adjust_text, const UChar *text_end, const UChar *text_start)
 
static UCharslow_search_backward_ic (OnigEncoding enc, int case_fold_flag, UChar *target, UChar *target_end, const UChar *text, const UChar *adjust_text, const UChar *text_end, const UChar *text_start)
 
static UCharbm_search_notrev (regex_t *reg, const UChar *target, const UChar *target_end, const UChar *text, const UChar *text_end, const UChar *text_range)
 
static UCharbm_search (regex_t *reg, const UChar *target, const UChar *target_end, const UChar *text, const UChar *text_end, const UChar *text_range)
 
static UCharbm_search_notrev_ic (regex_t *reg, const UChar *target, const UChar *target_end, const UChar *text, const UChar *text_end, const UChar *text_range)
 
static UCharbm_search_ic (regex_t *reg, const UChar *target, const UChar *target_end, const UChar *text, const UChar *text_end, const UChar *text_range)
 
static int set_bm_backward_skip (UChar *s, UChar *end, OnigEncoding enc ARG_UNUSED, int **skip)
 
static UCharbm_search_backward (regex_t *reg, const UChar *target, const UChar *target_end, const UChar *text, const UChar *adjust_text, const UChar *text_end, const UChar *text_start)
 
static UCharmap_search (OnigEncoding enc, UChar map[], const UChar *text, const UChar *text_range, const UChar *text_end)
 
static UCharmap_search_backward (OnigEncoding enc, UChar map[], const UChar *text, const UChar *adjust_text, const UChar *text_start, const UChar *text_end)
 
OnigPosition onig_match (regex_t *reg, const UChar *str, const UChar *end, const UChar *at, OnigRegion *region, OnigOptionType option)
 
static int forward_search_range (regex_t *reg, const UChar *str, const UChar *end, UChar *s, UChar *range, UChar **low, UChar **high, UChar **low_prev)
 
static int set_bm_backward_skip P_ ((UChar *s, UChar *end, OnigEncoding enc, int **skip))
 
static int backward_search_range (regex_t *reg, const UChar *str, const UChar *end, UChar *s, const UChar *range, UChar *adjrange, UChar **low, UChar **high)
 
OnigPosition onig_search (regex_t *reg, const UChar *str, const UChar *end, const UChar *start, const UChar *range, OnigRegion *region, OnigOptionType option)
 
OnigPosition onig_search_gpos (regex_t *reg, const UChar *str, const UChar *end, const UChar *global_pos, const UChar *start, const UChar *range, OnigRegion *region, OnigOptionType option)
 
OnigEncoding onig_get_encoding (regex_t *reg)
 
OnigOptionType onig_get_options (regex_t *reg)
 
OnigCaseFoldType onig_get_case_fold_flag (regex_t *reg)
 
const OnigSyntaxTypeonig_get_syntax (regex_t *reg)
 
int onig_number_of_captures (regex_t *reg)
 
int onig_number_of_capture_histories (regex_t *reg)
 
void onig_copy_encoding (OnigEncoding to, OnigEncoding from)
 

Variables

static unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE
 

Macro Definition Documentation

#define BM_BACKWARD_SEARCH_LENGTH_THRESHOLD   100

Definition at line 3769 of file regexec.c.

Referenced by backward_search_range().

#define DATA_ENSURE (   n)    if (s + (n) > end) goto fail

Definition at line 1094 of file regexec.c.

Referenced by match_at().

#define DATA_ENSURE_CHECK (   n)    (s + (n) <= end)

Definition at line 1093 of file regexec.c.

Referenced by match_at().

#define DATA_ENSURE_CHECK1   (s < end)

Definition at line 1092 of file regexec.c.

Referenced by match_at().

#define ELSE_IF_STATE_CHECK_MARK (   stk)

Definition at line 606 of file regexec.c.

#define GET_STACK_INDEX (   stk)    ((stk) - stk_base)

Definition at line 537 of file regexec.c.

Referenced by match_at().

#define INVALID_STACK_INDEX   -1

stack

Definition at line 358 of file regexec.c.

Referenced by match_at().

#define IS_EMPTY_STR   (str == end)

Definition at line 1084 of file regexec.c.

Referenced by match_at().

#define IS_TO_VOID_TARGET (   stk)    (((stk)->type & STK_MASK_TO_VOID_TARGET) != 0)

Definition at line 545 of file regexec.c.

#define MATCH_AND_RETURN_CHECK (   none)
Value:
r = match_at(reg, str, end, s, prev, &msa);\
if (r >= 0) {\
if (! IS_FIND_LONGEST(reg->options)) {\
goto match;\
}\
}\
else goto finish; /* error */ \
}
static OnigPosition match_at(regex_t *reg, const UChar *str, const UChar *end, const UChar *sstart, UChar *sprev, OnigMatchArg *msa)
Definition: regexec.c:1308
#define IS_FIND_LONGEST(option)
Definition: regint.h:365
#define ONIG_MISMATCH
else
Definition: ripper.y:7669
static int match(VALUE str, VALUE pat, VALUE hash, int(*cb)(VALUE, VALUE))
Definition: date_parse.c:273
if(c== ')') lex_state
Definition: ripper.y:7588

Referenced by onig_search_gpos().

#define MATCH_ARG_FREE (   msa)    if ((msa).stack_p) xfree((msa).stack_p)

Definition at line 442 of file regexec.c.

Referenced by onig_match(), and onig_search_gpos().

#define MATCH_ARG_INIT (   msa,
  arg_option,
  arg_region,
  arg_start,
  arg_gpos 
)
Value:
do {\
(msa).stack_p = (void* )0;\
(msa).options = (arg_option);\
(msa).region = (arg_region);\
(msa).start = (arg_start);\
(msa).gpos = (arg_gpos);\
(msa).best_len = ONIG_MISMATCH;\
} while(0)
static int options(unsigned char *cp)
Definition: nkf.c:6355
#define ONIG_MISMATCH

Definition at line 387 of file regexec.c.

Referenced by onig_match(), and onig_search_gpos().

#define MOP_IN (   opcode)

Definition at line 1288 of file regexec.c.

Referenced by match_at().

#define MOP_OUT

Definition at line 1289 of file regexec.c.

Referenced by match_at().

#define ON_STR_BEGIN (   s)    ((s) == str)

Definition at line 1085 of file regexec.c.

Referenced by backward_search_range(), forward_search_range(), and match_at().

#define ON_STR_END (   s)    ((s) == end)

Definition at line 1086 of file regexec.c.

Referenced by backward_search_range(), forward_search_range(), and match_at().

#define ONIGENC_IS_MBC_CRNL (   enc,
  p,
  end 
)
Value:
(ONIGENC_MBC_TO_CODE(enc,p,end) == 13 && \
ONIGENC_MBC_TO_CODE(enc,(p+enclen(enc,p,end)),end) == 10)
Win32OLEIDispatch * p
Definition: win32ole.c:786
#define enclen(enc, p, e)
#define ONIGENC_MBC_TO_CODE(enc, p, end)

Definition at line 36 of file regexec.c.

Referenced by match_at(), and onig_search_gpos().

#define ONIGENC_IS_MBC_NEWLINE_EX (   enc,
  p,
  start,
  end,
  option,
  check_prev 
)    is_mbc_newline_ex((enc),(p),(start),(end),(option),(check_prev))

Definition at line 39 of file regexec.c.

Referenced by backward_search_range(), forward_search_range(), match_at(), and onig_search_gpos().

#define RREGC_SIZE   (sizeof(int) * from->num_regs)
#define STACK_AT (   index)    (stk_base + (index))

Definition at line 536 of file regexec.c.

Referenced by match_at().

#define STACK_BASE_CHECK (   p,
  at 
)

Definition at line 748 of file regexec.c.

#define STACK_ENSURE (   n)
Value:
do {\
if (stk_end - stk < (n)) {\
int r = stack_double(&stk_base, &stk_end, &stk, stk_alloc, msa);\
if (r != 0) { STACK_SAVE; return r; } \
}\
} while(0)
#define STACK_SAVE
Definition: regexec.c:465
static int stack_double(OnigStackType **arg_stk_base, OnigStackType **arg_stk_end, OnigStackType **arg_stk, OnigStackType *stk_alloc, OnigMatchArg *msa)
Definition: regexec.c:488
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 529 of file regexec.c.

Referenced by match_at().

#define STACK_GET_MEM_RANGE (   k,
  mnum,
  start,
  end 
)
Value:
do {\
int level = 0;\
while (k < stk) {\
if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\
if (level == 0) (start) = k->u.mem.pstr;\
level++;\
}\
else if (k->type == STK_MEM_END && k->u.mem.num == (mnum)) {\
if (level == 0) {\
(end) = k->u.mem.pstr;\
break;\
}\
}\
k++;\
}\
} while(0)
#define STK_MEM_START
Definition: regexec.c:366
#define level
#define STK_MEM_END
Definition: regexec.c:367
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 694 of file regexec.c.

#define STACK_GET_MEM_START (   mnum,
 
)
Value:
do {\
int level = 0;\
k = stk;\
while (k > stk_base) {\
k--;\
if ((k->type & STK_MASK_MEM_END_OR_MARK) != 0 \
&& k->u.mem.num == (mnum)) {\
level++;\
}\
else if (k->type == STK_MEM_START && k->u.mem.num == (mnum)) {\
if (level == 0) break;\
level--;\
}\
}\
} while(0)
#define STK_MEM_START
Definition: regexec.c:366
#define level
#define STK_MASK_MEM_END_OR_MARK
Definition: regexec.c:384
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 678 of file regexec.c.

Referenced by match_at().

#define STACK_GET_REPEAT (   id,
 
)
Value:
do {\
int level = 0;\
k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_GET_REPEAT"); \
if (k->type == STK_REPEAT) {\
if (level == 0) {\
if (k->u.repeat.num == (id)) {\
break;\
}\
}\
}\
else if (k->type == STK_CALL_FRAME) level--;\
else if (k->type == STK_RETURN) level++;\
}\
} while(0)
#define STK_CALL_FRAME
Definition: regexec.c:377
#define STK_RETURN
Definition: regexec.c:378
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define level
#define STK_REPEAT
Definition: regexec.c:376
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 992 of file regexec.c.

Referenced by match_at().

#define STACK_INC   stk++

Definition at line 1286 of file regexec.c.

#define STACK_INIT (   alloc_addr,
  ptr_num,
  stack_num 
)
Value:
do {\
if (msa->stack_p) {\
alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num));\
stk_alloc = (OnigStackType* )(msa->stack_p);\
stk_base = stk_alloc;\
stk = stk_base;\
stk_end = stk_base + msa->stack_n;\
}\
alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num)\
+ sizeof(OnigStackType) * (stack_num));\
stk_alloc = (OnigStackType* )(alloc_addr + sizeof(OnigStackIndex) * (ptr_num));\
stk_base = stk_alloc;\
stk = stk_base;\
stk_end = stk_base + (stack_num);\
}\
} while(0)
intptr_t OnigStackIndex
Definition: regint.h:783
#define xalloca
Definition: regint.h:189
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 447 of file regexec.c.

Referenced by match_at().

#define STACK_NULL_CHECK (   isnull,
  id,
 
)
Value:
do {\
OnigStackType* k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_NULL_CHECK"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
(isnull) = (k->u.null_check.pstr == (s));\
break;\
}\
}\
}\
} while(0)
#define STK_NULL_CHECK_START
Definition: regexec.c:371
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
struct _OnigStackType OnigStackType
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 870 of file regexec.c.

Referenced by match_at().

#define STACK_NULL_CHECK_MEMST (   isnull,
  id,
  s,
  reg 
)

Definition at line 905 of file regexec.c.

Referenced by match_at().

#define STACK_NULL_CHECK_MEMST_REC (   isnull,
  id,
  s,
  reg 
)

Definition at line 944 of file regexec.c.

Referenced by match_at().

#define STACK_NULL_CHECK_REC (   isnull,
  id,
 
)
Value:
do {\
int level = 0;\
OnigStackType* k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_NULL_CHECK_REC"); \
if (k->type == STK_NULL_CHECK_START) {\
if (k->u.null_check.num == (id)) {\
if (level == 0) {\
(isnull) = (k->u.null_check.pstr == (s));\
break;\
}\
else level--;\
}\
}\
else if (k->type == STK_NULL_CHECK_END) {\
level++;\
}\
}\
} while(0)
#define STK_NULL_CHECK_START
Definition: regexec.c:371
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define level
#define STK_NULL_CHECK_END
Definition: regexec.c:372
else
Definition: ripper.y:7669
struct _OnigStackType OnigStackType
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 884 of file regexec.c.

Referenced by match_at().

#define STACK_POP

Definition at line 756 of file regexec.c.

Referenced by match_at().

#define STACK_POP_ONE
Value:
do {\
stk--;\
STACK_BASE_CHECK(stk, "STACK_POP_ONE"); \
} while(0)
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748

Definition at line 751 of file regexec.c.

Referenced by match_at().

#define STACK_POP_TIL_LOOK_BEHIND_NOT
Value:
do {\
while (1) {\
stk--;\
STACK_BASE_CHECK(stk, "STACK_POP_TIL_LOOK_BEHIND_NOT"); \
if (stk->type == STK_LOOK_BEHIND_NOT) break;\
else if (stk->type == STK_MEM_START) {\
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
else if (stk->type == STK_REPEAT_INC) {\
STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
}\
else if (stk->type == STK_MEM_END) {\
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
}\
} while(0)
#define STK_LOOK_BEHIND_NOT
Definition: regexec.c:363
#define STK_MEM_START
Definition: regexec.c:366
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
int type
Definition: tcltklib.c:111
#define STACK_AT(index)
Definition: regexec.c:536
#define STK_MEM_END
Definition: regexec.c:367
#define STK_REPEAT_INC
Definition: regexec.c:368
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588
#define ELSE_IF_STATE_CHECK_MARK(stk)
Definition: regexec.c:606

Definition at line 820 of file regexec.c.

Referenced by match_at().

#define STACK_POP_TIL_POS_NOT
Value:
do {\
while (1) {\
stk--;\
STACK_BASE_CHECK(stk, "STACK_POP_TIL_POS_NOT"); \
if (stk->type == STK_POS_NOT) break;\
else if (stk->type == STK_MEM_START) {\
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
else if (stk->type == STK_REPEAT_INC) {\
STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
}\
else if (stk->type == STK_MEM_END) {\
mem_start_stk[stk->u.mem.num] = stk->u.mem.start;\
mem_end_stk[stk->u.mem.num] = stk->u.mem.end;\
}\
}\
} while(0)
#define STK_MEM_START
Definition: regexec.c:366
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define STK_POS_NOT
Definition: regexec.c:364
int type
Definition: tcltklib.c:111
#define STACK_AT(index)
Definition: regexec.c:536
#define STK_MEM_END
Definition: regexec.c:367
#define STK_REPEAT_INC
Definition: regexec.c:368
else
Definition: ripper.y:7669
if(c== ')') lex_state
Definition: ripper.y:7588
#define ELSE_IF_STATE_CHECK_MARK(stk)
Definition: regexec.c:606

Definition at line 800 of file regexec.c.

Referenced by match_at().

#define STACK_POS_END (   k)
Value:
do {\
k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_POS_END"); \
k->type = STK_VOID;\
}\
else if (k->type == STK_POS) {\
k->type = STK_VOID;\
break;\
}\
}\
} while(0)
#define IS_TO_VOID_TARGET(stk)
Definition: regexec.c:545
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define STK_POS
Definition: regexec.c:374
else
Definition: ripper.y:7669
#define STK_VOID
Definition: regexec.c:379
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 840 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH (   stack_type,
  pat,
  s,
  sprev,
  keep 
)
Value:
do {\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
stk->u.state.pstr = (s);\
stk->u.state.pstr_prev = (sprev);\
stk->u.state.pkeep = (keep);\
} while(0)
VALUE stack_type
Definition: ripper.c:164
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STACK_INC
Definition: regexec.c:1286

Definition at line 608 of file regexec.c.

#define STACK_PUSH_ALT (   pat,
  s,
  sprev,
  keep 
)    STACK_PUSH(STK_ALT,pat,s,sprev,keep)

Definition at line 625 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_CALL_FRAME (   pat)
Value:
do {\
stk->type = STK_CALL_FRAME;\
stk->u.call_frame.ret_addr = (pat);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_CALL_FRAME
Definition: regexec.c:377
#define STACK_INC
Definition: regexec.c:1286

Definition at line 727 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_ENSURED (   stack_type,
  pat 
)
Value:
do {\
stk->type = (stack_type);\
stk->u.state.pcode = (pat);\
} while(0)
VALUE stack_type
Definition: ripper.c:164
#define STACK_INC
Definition: regexec.c:1286

Definition at line 618 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_LOOK_BEHIND_NOT (   pat,
  s,
  sprev,
  keep 
)    STACK_PUSH(STK_LOOK_BEHIND_NOT,pat,s,sprev,keep)

Definition at line 629 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_MEM_END (   mnum,
 
)
Value:
do {\
stk->type = STK_MEM_END;\
stk->u.mem.num = (mnum);\
stk->u.mem.pstr = (s);\
stk->u.mem.start = mem_start_stk[mnum];\
stk->u.mem.end = mem_end_stk[mnum];\
mem_end_stk[mnum] = GET_STACK_INDEX(stk);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define GET_STACK_INDEX(stk)
Definition: regexec.c:537
#define STK_MEM_END
Definition: regexec.c:367
#define STACK_INC
Definition: regexec.c:1286

Definition at line 660 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_MEM_END_MARK (   mnum)
Value:
do {\
stk->type = STK_MEM_END_MARK;\
stk->u.mem.num = (mnum);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_MEM_END_MARK
Definition: regexec.c:373
#define STACK_INC
Definition: regexec.c:1286

Definition at line 671 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_MEM_START (   mnum,
 
)
Value:
do {\
stk->type = STK_MEM_START;\
stk->u.mem.num = (mnum);\
stk->u.mem.pstr = (s);\
stk->u.mem.start = mem_start_stk[mnum];\
stk->u.mem.end = mem_end_stk[mnum];\
mem_start_stk[mnum] = GET_STACK_INDEX(stk);\
mem_end_stk[mnum] = INVALID_STACK_INDEX;\
} while(0)
#define STK_MEM_START
Definition: regexec.c:366
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define GET_STACK_INDEX(stk)
Definition: regexec.c:537
#define STACK_INC
Definition: regexec.c:1286
#define INVALID_STACK_INDEX
stack
Definition: regexec.c:358

Definition at line 648 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_NULL_CHECK_END (   cnum)
Value:
do {\
stk->type = STK_NULL_CHECK_END;\
stk->u.null_check.num = (cnum);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_NULL_CHECK_END
Definition: regexec.c:372
#define STACK_INC
Definition: regexec.c:1286

Definition at line 720 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_NULL_CHECK_START (   cnum,
 
)
Value:
do {\
stk->type = STK_NULL_CHECK_START;\
stk->u.null_check.num = (cnum);\
stk->u.null_check.pstr = (s);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_NULL_CHECK_START
Definition: regexec.c:371
#define STACK_INC
Definition: regexec.c:1286

Definition at line 712 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_POS (   s,
  sprev,
  keep 
)    STACK_PUSH(STK_POS,NULL_UCHARP,s,sprev,keep)

Definition at line 626 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_POS_NOT (   pat,
  s,
  sprev,
  keep 
)    STACK_PUSH(STK_POS_NOT,pat,s,sprev,keep)

Definition at line 627 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_REPEAT (   id,
  pat 
)
Value:
do {\
stk->type = STK_REPEAT;\
stk->u.repeat.num = (id);\
stk->u.repeat.pcode = (pat);\
stk->u.repeat.count = 0;\
} while(0)
const int id
Definition: nkf.c:209
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_REPEAT
Definition: regexec.c:376
#define STACK_INC
Definition: regexec.c:1286

Definition at line 632 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_REPEAT_INC (   sindex)
Value:
do {\
stk->type = STK_REPEAT_INC;\
stk->u.repeat_inc.si = (sindex);\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_REPEAT_INC
Definition: regexec.c:368
#define STACK_INC
Definition: regexec.c:1286

Definition at line 641 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_RETURN
Value:
do {\
stk->type = STK_RETURN;\
} while(0)
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STK_RETURN
Definition: regexec.c:378
#define STACK_INC
Definition: regexec.c:1286

Definition at line 734 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_STOP_BT   STACK_PUSH_TYPE(STK_STOP_BT)

Definition at line 628 of file regexec.c.

Referenced by match_at().

#define STACK_PUSH_TYPE (   stack_type)
Value:
do {\
stk->type = (stack_type);\
} while(0)
VALUE stack_type
Definition: ripper.c:164
#define STACK_ENSURE(n)
Definition: regexec.c:529
#define STACK_INC
Definition: regexec.c:1286

Definition at line 539 of file regexec.c.

#define STACK_RETURN (   addr)
Value:
do {\
int level = 0;\
OnigStackType* k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_RETURN"); \
if (k->type == STK_CALL_FRAME) {\
if (level == 0) {\
(addr) = k->u.call_frame.ret_addr;\
break;\
}\
else level--;\
}\
else if (k->type == STK_RETURN)\
level++;\
}\
} while(0)
#define STK_CALL_FRAME
Definition: regexec.c:377
#define STK_RETURN
Definition: regexec.c:378
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define level
else
Definition: ripper.y:7669
struct _OnigStackType OnigStackType
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 1010 of file regexec.c.

Referenced by match_at().

#define STACK_SAVE
Value:
do{\
if (stk_base != stk_alloc) {\
msa->stack_p = stk_base;\
msa->stack_n = stk_end - stk_base; /* TODO: check overflow */\
};\
} while(0)
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 465 of file regexec.c.

Referenced by match_at(), and stack_double().

#define STACK_STOP_BT_END
Value:
do {\
OnigStackType *k = stk;\
while (1) {\
k--;\
STACK_BASE_CHECK(k, "STACK_STOP_BT_END"); \
k->type = STK_VOID;\
}\
else if (k->type == STK_STOP_BT) {\
k->type = STK_VOID;\
break;\
}\
}\
} while(0)
#define IS_TO_VOID_TARGET(stk)
Definition: regexec.c:545
#define STACK_BASE_CHECK(p, at)
Definition: regexec.c:748
#define STK_STOP_BT
Definition: regexec.c:375
else
Definition: ripper.y:7669
struct _OnigStackType OnigStackType
#define STK_VOID
Definition: regexec.c:379
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 855 of file regexec.c.

Referenced by match_at().

#define STK_ALT   0x0001

Definition at line 362 of file regexec.c.

Referenced by match_at().

#define STK_CALL_FRAME   0x0800

Definition at line 377 of file regexec.c.

Referenced by backref_match_at_nested_level().

#define STK_LOOK_BEHIND_NOT   0x0002

Definition at line 363 of file regexec.c.

#define STK_MASK_MEM_END_OR_MARK   0x8000 /* MEM_END or MEM_END_MARK */

Definition at line 384 of file regexec.c.

#define STK_MASK_POP_USED   0x00ff

Definition at line 382 of file regexec.c.

#define STK_MASK_TO_VOID_TARGET   0x10ff

Definition at line 383 of file regexec.c.

#define STK_MEM_END   0x8200

Definition at line 367 of file regexec.c.

Referenced by backref_match_at_nested_level().

#define STK_MEM_END_MARK   0x8400

Definition at line 373 of file regexec.c.

#define STK_MEM_START   0x0100

Definition at line 366 of file regexec.c.

Referenced by backref_match_at_nested_level().

#define STK_NULL_CHECK_END   0x5000 /* for recursive call */

Definition at line 372 of file regexec.c.

#define STK_NULL_CHECK_START   0x3000

Definition at line 371 of file regexec.c.

#define STK_POS   0x0500 /* used when POP-POS */

Definition at line 374 of file regexec.c.

#define STK_POS_NOT   0x0003

Definition at line 364 of file regexec.c.

#define STK_REPEAT   0x0700

Definition at line 376 of file regexec.c.

#define STK_REPEAT_INC   0x0300

Definition at line 368 of file regexec.c.

#define STK_RETURN   0x0900

Definition at line 378 of file regexec.c.

Referenced by backref_match_at_nested_level().

#define STK_STATE_CHECK_MARK   0x1000

Definition at line 369 of file regexec.c.

Referenced by match_at().

#define STK_STOP_BT   0x0600 /* mark for "(?>...)" */

Definition at line 375 of file regexec.c.

#define STK_VOID   0x0a00 /* for fill a blank */

Definition at line 379 of file regexec.c.

#define STRING_CMP (   s1,
  s2,
  len 
)
Value:
do {\
while (len-- > 0) {\
if (*s1++ != *s2++) goto fail;\
}\
} while(0)
#define fail()
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 1029 of file regexec.c.

Referenced by match_at().

#define STRING_CMP_IC (   case_fold_flag,
  s1,
  ps2,
  len,
  text_end 
)
Value:
do {\
if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \
goto fail; \
} while(0)
#define fail()
static int string_cmp_ic(OnigEncoding enc, int case_fold_flag, UChar *s1, UChar **ps2, OnigDistance mblen, const UChar *text_end)
Definition: regexec.c:1040
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 1035 of file regexec.c.

Referenced by match_at().

#define STRING_CMP_VALUE (   s1,
  s2,
  len,
  is_fail 
)
Value:
do {\
is_fail = 0;\
while (len-- > 0) {\
if (*s1++ != *s2++) {\
is_fail = 1; break;\
}\
}\
} while(0)
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 1067 of file regexec.c.

Referenced by match_at().

#define STRING_CMP_VALUE_IC (   case_fold_flag,
  s1,
  ps2,
  len,
  text_end,
  is_fail 
)
Value:
do {\
if (string_cmp_ic(encode, case_fold_flag, s1, ps2, len, text_end) == 0) \
is_fail = 1; \
else \
is_fail = 0; \
} while(0)
static int string_cmp_ic(OnigEncoding enc, int case_fold_flag, UChar *s1, UChar **ps2, OnigDistance mblen, const UChar *text_end)
Definition: regexec.c:1040
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 1076 of file regexec.c.

Referenced by match_at().

Typedef Documentation

typedef int regoff_t

Definition at line 1295 of file regexec.c.

Function Documentation

static int backref_match_at_nested_level ( regex_t reg,
OnigStackType top,
OnigStackType stk_base,
int  ignore_case,
int  case_fold_flag,
int  nest,
int  mem_num,
UChar memp,
UChar **  s,
const UChar send 
)
static
static int backward_search_range ( regex_t reg,
const UChar str,
const UChar end,
UChar s,
const UChar range,
UChar adjrange,
UChar **  low,
UChar **  high 
)
static
static UChar* bm_search ( regex_t reg,
const UChar target,
const UChar target_end,
const UChar text,
const UChar text_end,
const UChar text_range 
)
static

Definition at line 3347 of file regexec.c.

References re_pattern_buffer::int_map, IS_NULL, re_pattern_buffer::map, NULL, p, tail, and UChar.

Referenced by forward_search_range().

static UChar* bm_search_backward ( regex_t reg,
const UChar target,
const UChar target_end,
const UChar text,
const UChar adjust_text,
const UChar text_end,
const UChar text_start 
)
static
static UChar* bm_search_ic ( regex_t reg,
const UChar target,
const UChar target_end,
const UChar text,
const UChar text_end,
const UChar text_range 
)
static
static UChar* bm_search_notrev ( regex_t reg,
const UChar target,
const UChar target_end,
const UChar text,
const UChar text_end,
const UChar text_range 
)
static
static UChar* bm_search_notrev_ic ( regex_t reg,
const UChar target,
const UChar target_end,
const UChar text,
const UChar text_end,
const UChar text_range 
)
static
static int forward_search_range ( regex_t reg,
const UChar str,
const UChar end,
UChar s,
UChar range,
UChar **  low,
UChar **  high,
UChar **  low_prev 
)
static
static int is_mbc_newline_ex ( OnigEncoding  enc,
const UChar p,
const UChar start,
const UChar end,
OnigOptionType  option,
int  check_prev 
)
static
static UChar* map_search ( OnigEncoding  enc,
UChar  map[],
const UChar text,
const UChar text_range,
const UChar text_end 
)
static

Definition at line 3543 of file regexec.c.

References enclen, NULL, and UChar.

Referenced by forward_search_range().

static UChar* map_search_backward ( OnigEncoding  enc,
UChar  map[],
const UChar text,
const UChar adjust_text,
const UChar text_start,
const UChar text_end 
)
static

Definition at line 3557 of file regexec.c.

References NULL, onigenc_get_prev_char_head(), and UChar.

Referenced by backward_search_range().

static OnigPosition match_at ( regex_t reg,
const UChar str,
const UChar end,
const UChar sstart,
UChar sprev,
OnigMatchArg msa 
)
static

Definition at line 1308 of file regexec.c.

References ALIGNMENT_RIGHT, backref_match_at_nested_level(), OnigCaptureTreeNodeStruct::beg, re_registers::beg, OnigMatchArg::best_len, OnigMatchArg::best_s, BIT_STATUS_AT, BITSET_AT, bp, re_pattern_buffer::bt_mem_end, re_pattern_buffer::bt_mem_start, buf, re_pattern_buffer::capture_history, re_pattern_buffer::case_fold_flag, CHECK_INTERRUPT_IN_MATCH_AT, CHECK_NULL_RETURN_MEMERR, DATA_ENSURE, DATA_ENSURE_CHECK, DATA_ENSURE_CHECK1, re_pattern_buffer::enc, enclen, OnigCaptureTreeNodeStruct::end, re_registers::end, fail, GET_ABSADDR_INC, GET_LENGTH_INC, GET_MEMNUM_INC, GET_OPTION_INC, GET_POINTER_INC, GET_RELADDR_INC, GET_STACK_INDEX, GET_STATE_CHECK_NUM_INC, OnigMatchArg::gpos, OnigCaptureTreeNodeStruct::group, re_registers::history_root, i, INIT_MATCH_STACK_SIZE, INVALID_STACK_INDEX, IS_EMPTY_STR, IS_FIND_CONDITION, IS_FIND_LONGEST, IS_FIND_NOT_EMPTY, IS_NEWLINE_CRLF, IS_NOTBOL, IS_NOTEOL, IS_NULL, IS_POSIX_REGION, level, OnigRepeatRange::lower, _OnigStackType::mem, MOP_IN, MOP_OUT, NULL, re_pattern_buffer::num_comb_exp_check, re_pattern_buffer::num_mem, re_pattern_buffer::num_repeat, ON_STR_BEGIN, ON_STR_END, onig_is_code_in_cc_len(), onig_is_in_code_range(), ONIG_MISMATCH, onig_print_compiled_byte_code(), ONIG_REGION_NOTPOS, onigenc_get_prev_char_head(), ONIGENC_IS_MBC_ASCII_WORD, ONIGENC_IS_MBC_CRNL, ONIGENC_IS_MBC_HEAD, ONIGENC_IS_MBC_NEWLINE, ONIGENC_IS_MBC_NEWLINE_EX, ONIGENC_IS_MBC_WORD, ONIGENC_MBC_CASE_FOLD, ONIGENC_MBC_CASE_FOLD_MAXLEN, ONIGENC_MBC_TO_CODE, ONIGENC_STEP_BACK, ONIGERR_STACK_BUG, ONIGERR_UNDEFINED_BYTECODE, ONIGERR_UNEXPECTED_BYTECODE, OP_ANYCHAR, OP_ANYCHAR_ML, OP_ANYCHAR_ML_STAR, OP_ANYCHAR_ML_STAR_PEEK_NEXT, OP_ANYCHAR_STAR, OP_ANYCHAR_STAR_PEEK_NEXT, OP_ASCII_WORD, OP_ASCII_WORD_BEGIN, OP_ASCII_WORD_BOUND, OP_ASCII_WORD_END, OP_BACKREF1, OP_BACKREF2, OP_BACKREF_MULTI, OP_BACKREF_MULTI_IC, OP_BACKREF_WITH_LEVEL, OP_BACKREFN, OP_BACKREFN_IC, OP_BEGIN_BUF, OP_BEGIN_LINE, OP_BEGIN_POS_OR_LINE, OP_BEGIN_POSITION, OP_CALL, OP_CCLASS, OP_CCLASS_MB, OP_CCLASS_MB_NOT, OP_CCLASS_MIX, OP_CCLASS_MIX_NOT, OP_CCLASS_NODE, OP_CCLASS_NOT, OP_CONDITION, OP_END, OP_END_BUF, OP_END_LINE, 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, OP_EXACTN_IC, OP_FAIL, OP_FAIL_LOOK_BEHIND_NOT, OP_FAIL_POS, OP_FINISH, OP_JUMP, OP_KEEP, OP_LOOK_BEHIND, OP_MEMORY_END, OP_MEMORY_END_PUSH, OP_MEMORY_END_PUSH_REC, OP_MEMORY_END_REC, OP_MEMORY_START, OP_MEMORY_START_PUSH, OP_NOT_ASCII_WORD, OP_NOT_ASCII_WORD_BOUND, OP_NOT_WORD, OP_NOT_WORD_BOUND, OP_NULL_CHECK_END, OP_NULL_CHECK_END_MEMST, OP_NULL_CHECK_END_MEMST_PUSH, OP_NULL_CHECK_START, OP_POP, OP_POP_POS, OP_POP_STOP_BT, OP_PUSH, OP_PUSH_IF_PEEK_NEXT, OP_PUSH_LOOK_BEHIND_NOT, OP_PUSH_OR_JUMP_EXACT1, OP_PUSH_POS, OP_PUSH_POS_NOT, OP_PUSH_STOP_BT, OP_REPEAT, OP_REPEAT_INC, OP_REPEAT_INC_NG, OP_REPEAT_INC_NG_SG, OP_REPEAT_INC_SG, OP_REPEAT_NG, OP_RETURN, OP_SEMI_END_BUF, OP_SET_OPTION, OP_SET_OPTION_PUSH, OP_STATE_CHECK, OP_STATE_CHECK_ANYCHAR_ML_STAR, OP_STATE_CHECK_ANYCHAR_STAR, OP_STATE_CHECK_PUSH, OP_STATE_CHECK_PUSH_OR_JUMP, OP_WORD, OP_WORD_BEGIN, OP_WORD_BOUND, OP_WORD_END, re_pattern_buffer::options, OnigMatchArg::options, re_pattern_buffer::p, p, OnigMatchArg::region, _OnigStackType::repeat, re_pattern_buffer::repeat_range, posix_regmatch_t::rm_eo, posix_regmatch_t::rm_so, SIZE_BITSET, SIZE_MEMNUM, SIZE_OP_FAIL, SIZE_OP_SET_OPTION, SIZE_RELADDR, STACK_AT, STACK_ENSURE, STACK_GET_MEM_START, STACK_GET_REPEAT, STACK_INIT, STACK_NULL_CHECK, STACK_NULL_CHECK_MEMST, STACK_NULL_CHECK_MEMST_REC, STACK_NULL_CHECK_REC, STACK_POP, re_pattern_buffer::stack_pop_level, STACK_POP_ONE, STACK_POP_TIL_LOOK_BEHIND_NOT, STACK_POP_TIL_POS_NOT, STACK_POS_END, STACK_PUSH_ALT, STACK_PUSH_CALL_FRAME, STACK_PUSH_ENSURED, STACK_PUSH_LOOK_BEHIND_NOT, STACK_PUSH_MEM_END, STACK_PUSH_MEM_END_MARK, STACK_PUSH_MEM_START, STACK_PUSH_NULL_CHECK_END, STACK_PUSH_NULL_CHECK_START, STACK_PUSH_POS, STACK_PUSH_POS_NOT, STACK_PUSH_REPEAT, STACK_PUSH_REPEAT_INC, STACK_PUSH_RETURN, STACK_PUSH_STOP_BT, STACK_RETURN, STACK_SAVE, STACK_STOP_BT_END, _OnigStackType::state, STK_ALT, STK_STATE_CHECK_MARK, STRING_CMP, STRING_CMP_IC, STRING_CMP_VALUE, STRING_CMP_VALUE_IC, strlen(), _OnigStackType::type, _OnigStackType::u, UChar, OnigRepeatRange::upper, USE_CRNL_AS_LINE_TERMINATOR, and xmemcpy.

Referenced by onig_match().

static int mem_is_in_memp ( int  mem,
int  num,
UChar memp 
)
static

Definition at line 1144 of file regexec.c.

References GET_MEMNUM_INC, and i.

Referenced by backref_match_at_nested_level().

void onig_copy_encoding ( OnigEncoding  to,
OnigEncoding  from 
)

Definition at line 4339 of file regexec.c.

OnigCaseFoldType onig_get_case_fold_flag ( regex_t reg)

Definition at line 4304 of file regexec.c.

References re_pattern_buffer::case_fold_flag.

OnigEncoding onig_get_encoding ( regex_t reg)

Definition at line 4292 of file regexec.c.

References re_pattern_buffer::enc.

unsigned int onig_get_match_stack_limit_size ( void  )

Definition at line 475 of file regexec.c.

References MatchStackLimitSize.

OnigOptionType onig_get_options ( regex_t reg)

Definition at line 4298 of file regexec.c.

References re_pattern_buffer::options.

const OnigSyntaxType* onig_get_syntax ( regex_t reg)

Definition at line 4310 of file regexec.c.

References re_pattern_buffer::syntax.

OnigPosition onig_match ( regex_t reg,
const UChar str,
const UChar end,
const UChar at,
OnigRegion region,
OnigOptionType  option 
)
int onig_number_of_capture_histories ( regex_t reg)
int onig_number_of_captures ( regex_t reg)

Definition at line 4316 of file regexec.c.

References re_pattern_buffer::num_mem.

void onig_print_compiled_byte_code ( FILE f,
UChar bp,
UChar bpend,
UChar **  nextp,
OnigEncoding  enc 
)

Referenced by match_at().

void onig_region_clear ( OnigRegion region)
void onig_region_copy ( OnigRegion to,
OnigRegion from 
)
void onig_region_free ( OnigRegion r,
int  free_self 
)

Definition at line 315 of file regexec.c.

References re_registers::allocated, re_registers::beg, re_registers::end, and xfree.

Referenced by obj_free(), rb_reg_search(), and strscan_free().

void onig_region_init ( OnigRegion region)
OnigRegion* onig_region_new ( void  )

Definition at line 304 of file regexec.c.

References onig_region_init(), and xmalloc.

int onig_region_resize ( OnigRegion region,
int  n 
)
static int onig_region_resize_clear ( OnigRegion region,
int  n 
)
static

Definition at line 268 of file regexec.c.

References onig_region_clear(), and onig_region_resize().

Referenced by onig_match(), and onig_search_gpos().

int onig_region_set ( OnigRegion region,
int  at,
int  beg,
int  end 
)
OnigPosition onig_search ( regex_t reg,
const UChar str,
const UChar end,
const UChar start,
const UChar range,
OnigRegion region,
OnigOptionType  option 
)

Definition at line 3875 of file regexec.c.

References onig_search_gpos().

Referenced by rb_reg_search(), and strscan_do_scan().

OnigPosition onig_search_gpos ( regex_t reg,
const UChar str,
const UChar end,
const UChar global_pos,
const UChar start,
const UChar range,
OnigRegion region,
OnigOptionType  option 
)
int onig_set_match_stack_limit_size ( unsigned int  size)

Definition at line 481 of file regexec.c.

References size.

static int set_bm_backward_skip P_ ( (UChar *s, UChar *end, OnigEncoding enc, int **skip)  )
static
static int set_bm_backward_skip ( UChar s,
UChar end,
OnigEncoding enc  ARG_UNUSED,
int **  skip 
)
static

Definition at line 3493 of file regexec.c.

References i, IS_NULL, ONIG_CHAR_TABLE_SIZE, ONIGERR_MEMORY, and xmalloc.

Referenced by backward_search_range().

static UChar* slow_search ( OnigEncoding  enc,
UChar target,
UChar target_end,
const UChar text,
const UChar text_end,
UChar text_range 
)
static
static UChar* slow_search_backward ( OnigEncoding  enc,
UChar target,
UChar target_end,
const UChar text,
const UChar adjust_text,
const UChar text_end,
const UChar text_start 
)
static

Definition at line 3023 of file regexec.c.

References NULL, onigenc_get_prev_char_head(), ONIGENC_LEFT_ADJUST_CHAR_HEAD, p, and UChar.

Referenced by backward_search_range().

static UChar* slow_search_backward_ic ( OnigEncoding  enc,
int  case_fold_flag,
UChar target,
UChar target_end,
const UChar text,
const UChar adjust_text,
const UChar text_end,
const UChar text_start 
)
static
static UChar* slow_search_ic ( OnigEncoding  enc,
int  case_fold_flag,
UChar target,
UChar target_end,
const UChar text,
const UChar text_end,
UChar text_range 
)
static

Definition at line 2998 of file regexec.c.

References enclen, NULL, str_lower_case_match(), and UChar.

Referenced by forward_search_range().

static int stack_double ( OnigStackType **  arg_stk_base,
OnigStackType **  arg_stk_end,
OnigStackType **  arg_stk,
OnigStackType stk_alloc,
OnigMatchArg msa 
)
static
static int str_lower_case_match ( OnigEncoding  enc,
int  case_fold_flag,
const UChar t,
const UChar tend,
const UChar p,
const UChar end 
)
static
static int string_cmp_ic ( OnigEncoding  enc,
int  case_fold_flag,
UChar s1,
UChar **  ps2,
OnigDistance  mblen,
const UChar text_end 
)
static

Definition at line 1040 of file regexec.c.

References ONIGENC_MBC_CASE_FOLD, ONIGENC_MBC_CASE_FOLD_MAXLEN, and UChar.

Referenced by backref_match_at_nested_level().

Variable Documentation

unsigned int MatchStackLimitSize = DEFAULT_MATCH_STACK_LIMIT_SIZE
static

Definition at line 472 of file regexec.c.

Referenced by onig_get_match_stack_limit_size(), and stack_double().