Lines Matching refs:ofs

441 loop_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs)  in loop_greedy()  argument
445 matched_offset = *ofs; in loop_greedy()
447 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_greedy()
448 saved_offset = *ofs; in loop_greedy()
449 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_greedy()
451 *ofs = saved_offset; in loop_greedy()
454 *ofs = matched_offset; in loop_greedy()
458 loop_non_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs) in loop_non_greedy() argument
460 int saved_offset = *ofs; in loop_non_greedy()
462 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_non_greedy()
463 saved_offset = *ofs; in loop_non_greedy()
464 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_non_greedy()
468 *ofs = saved_offset; in loop_non_greedy()
472 is_any_of(const unsigned char *p, int len, const char *s, int *ofs) in is_any_of() argument
476 ch = s[*ofs]; in is_any_of()
480 (*ofs)++; in is_any_of()
488 is_any_but(const unsigned char *p, int len, const char *s, int *ofs) in is_any_but() argument
492 ch = s[*ofs]; in is_any_but()
499 (*ofs)++; in is_any_but()
505 int *ofs, struct cap *caps) in match() argument
516 saved_offset = *ofs; in match()
517 res = match(r, pc + 3, s, len, ofs, caps); in match()
519 *ofs = saved_offset; in match()
521 s, len, ofs, caps); in match()
528 if (n <= len - *ofs && !memcmp(s + *ofs, r->data + in match()
530 (*ofs) += n; in match()
537 saved_offset = *ofs; in match()
538 if (!match(r, pc + 2, s, len, ofs, caps)) in match()
539 *ofs = saved_offset; in match()
544 loop_greedy(r, pc, s, len, ofs); in match()
549 loop_non_greedy(r, pc, s, len, ofs); in match()
553 res = match(r, pc + 2, s, len, ofs, caps); in match()
557 loop_greedy(r, pc, s, len, ofs); in match()
561 res = match(r, pc + 2, s, len, ofs, caps); in match()
565 loop_non_greedy(r, pc, s, len, ofs); in match()
570 if (*ofs < len && isspace(((unsigned char *)s)[*ofs])) { in match()
571 (*ofs)++; in match()
578 if (*ofs < len && in match()
579 !isspace(((unsigned char *)s)[*ofs])) { in match()
580 (*ofs)++; in match()
587 if (*ofs < len && isdigit(((unsigned char *)s)[*ofs])) { in match()
588 (*ofs)++; in match()
595 if (*ofs < len) { in match()
596 (*ofs)++; in match()
603 if (*ofs < len) in match()
605 r->code[pc + 2], s, ofs); in match()
610 if (*ofs < len) in match()
612 r->code[pc + 2], s, ofs); in match()
616 res = *ofs == 0 ? 1 : 0; in match()
620 res = *ofs == len ? 1 : 0; in match()
625 caps[r->code[pc + 1]].ptr = s + *ofs; in match()
630 caps[r->code[pc + 1]].len = (s + *ofs) - in match()
651 int i, ofs = 0, res = 0; in slre_match() local
654 res = match(r, 0, buf, len, &ofs, caps); in slre_match()
657 ofs = i; in slre_match()
658 res = match(r, 0, buf, len, &ofs, caps); in slre_match()