Home | History | Annotate | Download | only in lib

Lines Matching defs:pmatch

44 					 size_t nmatch, regmatch_t pmatch[],
57 static unsigned int re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
67 static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
77 size_t nmatch, regmatch_t *pmatch,
216 `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
227 regexec (preg, string, nmatch, pmatch, eflags)
231 regmatch_t pmatch[_Restrict_arr_];
245 start = pmatch[0].rm_so;
246 length = pmatch[0].rm_eo;
260 length, nmatch, pmatch, eflags);
276 regmatch_t pmatch[], int eflags)
278 return regexec (preg, string, nmatch, pmatch,
427 regmatch_t *pmatch;
472 pmatch = re_malloc (regmatch_t, nregs);
473 if (BE (pmatch == NULL, 0))
480 nregs, pmatch, eflags);
490 bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
500 assert (pmatch[0].rm_so == start);
501 rval = pmatch[0].rm_eo - start;
504 rval = pmatch[0].rm_so;
506 re_free (pmatch);
514 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
569 regs->start[i] = pmatch[i].rm_so;
570 regs->end[i] = pmatch[i].rm_eo;
636 length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same
649 size_t nmatch, regmatch_t pmatch[],
906 /* Set pmatch[] if we need. */
913 pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
916 pmatch[0].rm_so = 0;
917 pmatch[0].rm_eo = mctx.match_last;
924 err = set_regs (preg, &mctx, nmatch, pmatch,
934 if (pmatch[reg_idx].rm_so != -1)
939 pmatch[reg_idx].rm_so =
940 (pmatch[reg_idx].rm_so == mctx.input.valid_len
942 : mctx.input.offsets[pmatch[reg_idx].rm_so]);
943 pmatch[reg_idx].rm_eo =
944 (pmatch[reg_idx].rm_eo == mctx.input.valid_len
946 : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
951 pmatch[reg_idx].rm_so += match_first;
952 pmatch[reg_idx].rm_eo += match_first;
956 pmatch[nmatch + reg_idx].rm_so = -1;
957 pmatch[nmatch + reg_idx].rm_eo = -1;
964 pmatch[reg_idx + 1].rm_so
965 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
966 pmatch[reg_idx + 1].rm_eo
967 = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
1435 PMATCH.
1436 Note: We assume that pmatch[0] is already set, and
1437 pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
1442 regmatch_t *pmatch, bool fl_backtrack)
1481 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1483 for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
1485 update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
1487 if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
1493 if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
1502 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1515 cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
1529 cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
1565 update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
1576 pmatch[reg_num].rm_so = cur_idx;
1577 pmatch[reg_num].rm_eo = -1;
1586 if (pmatch[reg_num].rm_so < cur_idx)
1588 pmatch[reg_num].rm_eo = cur_idx;
1591 memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
1602 memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
1606 pmatch[reg_num].rm_eo = cur_idx;