Lines Matching refs:pmatch

42 					 size_t nmatch, regmatch_t pmatch[],
53 static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
68 static void update_regs (re_dfa_t *dfa, regmatch_t *pmatch,
83 size_t nmatch, regmatch_t *pmatch,
214 regexec (preg, string, nmatch, pmatch, eflags)
218 regmatch_t pmatch[];
229 start = pmatch[0].rm_so;
230 length = pmatch[0].rm_eo;
242 length, nmatch, pmatch, eflags);
257 regmatch_t pmatch[], int eflags)
259 return regexec (preg, string, nmatch, pmatch,
403 regmatch_t *pmatch;
441 pmatch = re_malloc (regmatch_t, nregs);
442 if (BE (pmatch == NULL, 0))
446 nregs, pmatch, eflags);
456 bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
466 assert (pmatch[0].rm_so == start);
467 rval = pmatch[0].rm_eo - start;
470 rval = pmatch[0].rm_so;
472 re_free (pmatch);
477 re_copy_regs (regs, pmatch, nregs, regs_allocated)
479 regmatch_t *pmatch;
523 regs->start[i] = pmatch[i].rm_so;
524 regs->end[i] = pmatch[i].rm_eo;
599 re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
605 regmatch_t pmatch[];
847 /* Set pmatch[] if we need. */
854 pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
857 pmatch[0].rm_so = 0;
858 pmatch[0].rm_eo = mctx.match_last;
862 err = set_regs (preg, &mctx, nmatch, pmatch,
872 if (pmatch[reg_idx].rm_so != -1)
877 if (pmatch[reg_idx].rm_so == mctx.input.valid_len)
878 pmatch[reg_idx].rm_so += mctx.input.valid_raw_len - mctx.input.valid_len;
880 pmatch[reg_idx].rm_so = mctx.input.offsets[pmatch[reg_idx].rm_so];
881 if (pmatch[reg_idx].rm_eo == mctx.input.valid_len)
882 pmatch[reg_idx].rm_eo += mctx.input.valid_raw_len - mctx.input.valid_len;
884 pmatch[reg_idx].rm_eo = mctx.input.offsets[pmatch[reg_idx].rm_eo];
889 pmatch[reg_idx].rm_so += match_first;
890 pmatch[reg_idx].rm_eo += match_first;
894 pmatch[nmatch + reg_idx].rm_so = -1;
895 pmatch[nmatch + reg_idx].rm_eo = -1;
902 pmatch[reg_idx + 1].rm_so
903 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
904 pmatch[reg_idx + 1].rm_eo
905 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
1372 Note: We assume that pmatch[0] is already set, and
1373 pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
1376 set_regs (preg, mctx, nmatch, pmatch, fl_backtrack)
1380 regmatch_t *pmatch;
1408 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1410 for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
1412 update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
1414 if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
1420 if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
1427 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1438 cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
1450 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1481 update_regs (dfa, pmatch, prev_idx_match, cur_node, cur_idx, nmatch)
1483 regmatch_t *pmatch, *prev_idx_match;
1494 pmatch[reg_num].rm_so = cur_idx;
1495 pmatch[reg_num].rm_eo = -1;
1504 if (pmatch[reg_num].rm_so < cur_idx)
1506 pmatch[reg_num].rm_eo = cur_idx;
1509 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1520 memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
1524 pmatch[reg_num].rm_eo = cur_idx;