Home | History | Annotate | Download | only in lib

Lines Matching refs:ofs

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