Lines Matching refs:pmatch
44 size_t nmatch, regmatch_t pmatch[],
57 static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
67 static void update_regs (re_dfa_t *dfa, regmatch_t *pmatch,
76 size_t nmatch, regmatch_t *pmatch,
193 `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
205 size_t nmatch, regmatch_t pmatch[], int eflags)
218 start = pmatch[0].rm_so;
219 length = pmatch[0].rm_eo;
233 length, nmatch, pmatch, eflags);
249 regmatch_t pmatch[], int eflags)
251 return regexec (preg, string, nmatch, pmatch,
386 regmatch_t *pmatch;
453 pmatch = re_xmalloc (regmatch_t, nregs);
454 if (BE (pmatch == NULL, 0))
461 nregs, pmatch, eflags);
471 bufp->re_regs_allocated = re_copy_regs (regs, pmatch, nregs,
481 assert (pmatch[0].rm_so == start);
482 rval = pmatch[0].rm_eo - start;
485 rval = pmatch[0].rm_so;
487 re_free (pmatch);
495 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
540 regs->rm_start[i] = pmatch[i].rm_so;
541 regs->rm_end[i] = pmatch[i].rm_eo;
603 length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same
616 size_t nmatch, regmatch_t pmatch[],
866 /* Set pmatch[] if we need. */
873 pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
876 pmatch[0].rm_so = 0;
877 pmatch[0].rm_eo = mctx.match_last;
884 err = set_regs (preg, &mctx, nmatch, pmatch,
894 if (pmatch[reg_idx].rm_so != -1)
899 pmatch[reg_idx].rm_so =
900 (pmatch[reg_idx].rm_so == mctx.input.valid_len
902 : mctx.input.offsets[pmatch[reg_idx].rm_so]);
903 pmatch[reg_idx].rm_eo =
904 (pmatch[reg_idx].rm_eo == mctx.input.valid_len
906 : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
911 pmatch[reg_idx].rm_so += match_first;
912 pmatch[reg_idx].rm_eo += match_first;
916 pmatch[nmatch + reg_idx].rm_so = -1;
917 pmatch[nmatch + reg_idx].rm_eo = -1;
924 pmatch[reg_idx + 1].rm_so
925 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
926 pmatch[reg_idx + 1].rm_eo
927 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
1383 PMATCH.
1384 Note: We assume that pmatch[0] is already set, and
1385 pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
1390 size_t nmatch, regmatch_t *pmatch, bool fl_backtrack)
1436 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1438 for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
1440 update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
1442 if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
1448 if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
1457 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1470 cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
1484 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1520 update_regs (re_dfa_t *dfa, regmatch_t *pmatch, regmatch_t *prev_idx_match,
1531 pmatch[reg_num].rm_so = cur_idx;
1532 pmatch[reg_num].rm_eo = -1;
1541 if (pmatch[reg_num].rm_so < cur_idx)
1543 pmatch[reg_num].rm_eo = cur_idx;
1546 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1557 memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
1561 pmatch[reg_num].rm_eo = cur_idx;