Lines Matching refs:pmatch

41 					 size_t nmatch, regmatch_t pmatch[],
52 static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
61 static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
71 size_t nmatch, regmatch_t *pmatch,
221 regexec (preg, string, nmatch, pmatch, eflags)
225 regmatch_t pmatch[];
237 start = pmatch[0].rm_so;
238 length = pmatch[0].rm_eo;
252 length, nmatch, pmatch, eflags);
268 regmatch_t pmatch[], int eflags)
270 return regexec (preg, string, nmatch, pmatch,
415 regmatch_t *pmatch;
456 pmatch = re_malloc (regmatch_t, nregs);
457 if (BE (pmatch == NULL, 0))
464 nregs, pmatch, eflags);
474 bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
484 assert (pmatch[0].rm_so == start);
485 rval = pmatch[0].rm_eo - start;
488 rval = pmatch[0].rm_so;
490 re_free (pmatch);
497 re_copy_regs (regs, pmatch, nregs, regs_allocated)
499 regmatch_t *pmatch;
554 regs->start[i] = pmatch[i].rm_so;
555 regs->end[i] = pmatch[i].rm_eo;
631 re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
637 regmatch_t pmatch[];
886 /* Set pmatch[] if we need. */
893 pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
896 pmatch[0].rm_so = 0;
897 pmatch[0].rm_eo = mctx.match_last;
901 err = set_regs (preg, &mctx, nmatch, pmatch,
911 if (pmatch[reg_idx].rm_so != -1)
916 pmatch[reg_idx].rm_so =
917 (pmatch[reg_idx].rm_so == mctx.input.valid_len
919 : mctx.input.offsets[pmatch[reg_idx].rm_so]);
920 pmatch[reg_idx].rm_eo =
921 (pmatch[reg_idx].rm_eo == mctx.input.valid_len
923 : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
928 pmatch[reg_idx].rm_so += match_first;
929 pmatch[reg_idx].rm_eo += match_first;
933 pmatch[nmatch + reg_idx].rm_so = -1;
934 pmatch[nmatch + reg_idx].rm_eo = -1;
941 pmatch[reg_idx + 1].rm_so
942 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
943 pmatch[reg_idx + 1].rm_eo
944 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
1413 Note: We assume that pmatch[0] is already set, and
1414 pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
1419 regmatch_t *pmatch, int fl_backtrack)
1458 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1460 for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
1462 update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
1464 if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
1470 if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
1479 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1492 cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
1506 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1542 update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
1553 pmatch[reg_num].rm_so = cur_idx;
1554 pmatch[reg_num].rm_eo = -1;
1563 if (pmatch[reg_num].rm_so < cur_idx)
1565 pmatch[reg_num].rm_eo = cur_idx;
1568 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1579 memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
1583 pmatch[reg_num].rm_eo = cur_idx;