Lines Matching refs:ofs
440 loop_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs) in loop_greedy() argument
444 matched_offset = *ofs; in loop_greedy()
446 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_greedy()
447 saved_offset = *ofs; in loop_greedy()
448 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_greedy()
450 *ofs = saved_offset; in loop_greedy()
453 *ofs = matched_offset; in loop_greedy()
457 loop_non_greedy(const struct slre *r, int pc, const char *s, int len, int *ofs) in loop_non_greedy() argument
459 int saved_offset = *ofs; in loop_non_greedy()
461 while (match(r, pc + 2, s, len, ofs, NULL)) { in loop_non_greedy()
462 saved_offset = *ofs; in loop_non_greedy()
463 if (match(r, pc + r->code[pc + 1], s, len, ofs, NULL)) in loop_non_greedy()
467 *ofs = saved_offset; in loop_non_greedy()
471 is_any_of(const unsigned char *p, int len, const char *s, int *ofs) in is_any_of() argument
475 ch = s[*ofs]; in is_any_of()
479 (*ofs)++; in is_any_of()
487 is_any_but(const unsigned char *p, int len, const char *s, int *ofs) in is_any_but() argument
491 ch = s[*ofs]; in is_any_but()
498 (*ofs)++; in is_any_but()
504 int *ofs, struct cap *caps) in match() argument
515 saved_offset = *ofs; in match()
516 res = match(r, pc + 3, s, len, ofs, caps); in match()
518 *ofs = saved_offset; in match()
520 s, len, ofs, caps); in match()
527 if (n <= len - *ofs && !memcmp(s + *ofs, r->data + in match()
529 (*ofs) += n; in match()
536 saved_offset = *ofs; in match()
537 if (!match(r, pc + 2, s, len, ofs, caps)) in match()
538 *ofs = saved_offset; in match()
543 loop_greedy(r, pc, s, len, ofs); in match()
548 loop_non_greedy(r, pc, s, len, ofs); in match()
552 res = match(r, pc + 2, s, len, ofs, caps); in match()
556 loop_greedy(r, pc, s, len, ofs); in match()
560 res = match(r, pc + 2, s, len, ofs, caps); in match()
564 loop_non_greedy(r, pc, s, len, ofs); in match()
569 if (*ofs < len && isspace(((unsigned char *)s)[*ofs])) { in match()
570 (*ofs)++; in match()
577 if (*ofs < len && in match()
578 !isspace(((unsigned char *)s)[*ofs])) { in match()
579 (*ofs)++; in match()
586 if (*ofs < len && isdigit(((unsigned char *)s)[*ofs])) { in match()
587 (*ofs)++; in match()
594 if (*ofs < len) { in match()
595 (*ofs)++; in match()
602 if (*ofs < len) in match()
604 r->code[pc + 2], s, ofs); in match()
609 if (*ofs < len) in match()
611 r->code[pc + 2], s, ofs); in match()
615 res = *ofs == 0 ? 1 : 0; in match()
619 res = *ofs == len ? 1 : 0; in match()
624 caps[r->code[pc + 1]].ptr = s + *ofs; in match()
629 caps[r->code[pc + 1]].len = (s + *ofs) - in match()
650 int i, ofs = 0, res = 0; in slre_match() local
653 res = match(r, 0, buf, len, &ofs, caps); in slre_match()
656 ofs = i; in slre_match()
657 res = match(r, 0, buf, len, &ofs, caps); in slre_match()