Lines Matching refs:region
152 onig_get_capture_tree(OnigRegion* region) in onig_get_capture_tree() argument
154 return region->history_root; in onig_get_capture_tree()
159 onig_region_clear(OnigRegion* region) in onig_region_clear() argument
163 for (i = 0; i < region->num_regs; i++) { in onig_region_clear()
164 region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; in onig_region_clear()
167 history_root_free(region); in onig_region_clear()
172 onig_region_resize(OnigRegion* region, int n) in onig_region_resize() argument
174 region->num_regs = n; in onig_region_resize()
179 if (region->allocated == 0) { in onig_region_resize()
180 region->beg = (int* )xmalloc(n * sizeof(int)); in onig_region_resize()
181 region->end = (int* )xmalloc(n * sizeof(int)); in onig_region_resize()
183 if (region->beg == 0 || region->end == 0) in onig_region_resize()
186 region->allocated = n; in onig_region_resize()
188 else if (region->allocated < n) { in onig_region_resize()
189 region->beg = (int* )xrealloc(region->beg, n * sizeof(int)); in onig_region_resize()
190 region->end = (int* )xrealloc(region->end, n * sizeof(int)); in onig_region_resize()
192 if (region->beg == 0 || region->end == 0) in onig_region_resize()
195 region->allocated = n; in onig_region_resize()
202 onig_region_resize_clear(OnigRegion* region, int n) in onig_region_resize_clear() argument
206 r = onig_region_resize(region, n); in onig_region_resize_clear()
208 onig_region_clear(region); in onig_region_resize_clear()
213 onig_region_set(OnigRegion* region, int at, int beg, int end) in onig_region_set() argument
217 if (at >= region->allocated) { in onig_region_set()
218 int r = onig_region_resize(region, at + 1); in onig_region_set()
222 region->beg[at] = beg; in onig_region_set()
223 region->end[at] = end; in onig_region_set()
228 onig_region_init(OnigRegion* region) in onig_region_init() argument
230 region->num_regs = 0; in onig_region_init()
231 region->allocated = 0; in onig_region_init()
232 region->beg = (int* )0; in onig_region_init()
233 region->end = (int* )0; in onig_region_init()
234 region->history_root = (OnigCaptureTreeNode* )0; in onig_region_init()
333 (msa).region = (arg_region);\
341 (msa).region = (arg_region);\
1319 OnigRegion* region; in match_at() local
1331 region = msa->region; in match_at()
1332 if (region) { in match_at()
1335 posix_regmatch_t* rmt = (posix_regmatch_t* )region; in match_at()
1357 region->beg[0] = sstart - str; in match_at()
1358 region->end[0] = s - str; in match_at()
1362 region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str; in match_at()
1364 region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str; in match_at()
1366 region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i) in match_at()
1371 region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS; in match_at()
1380 if (IS_NULL(region->history_root)) { in match_at()
1381 region->history_root = node = history_node_new(); in match_at()
1385 node = region->history_root; in match_at()
1394 r = make_capture_history_tree(region->history_root, &stkp, in match_at()
3044 onig_match(regex_t* reg, const UChar* str, const UChar* end, const UChar* at, OnigRegion* region, in onig_match() argument
3076 MATCH_ARG_INIT(msa, option, region, at); in onig_match()
3084 if (region in onig_match()
3089 r = onig_region_resize_clear(region, reg->num_mem + 1); in onig_match()
3355 const UChar* start, const UChar* range, OnigRegion* region, OnigOptionType option) in onig_search() argument
3396 if (region in onig_search()
3401 r = onig_region_resize_clear(region, reg->num_mem + 1); in onig_search()
3554 MATCH_ARG_INIT(msa, option, region, start); in onig_search()
3570 MATCH_ARG_INIT(msa, option, region, orig_start); in onig_search()
3725 if (IS_FIND_NOT_EMPTY(reg->options) && region in onig_search()
3730 onig_region_clear(region); in onig_search()