Lines Matching refs:b

30 #define NEED(p,b,n,r)	\  argument
33 if (((b)->re_end - (b)->re_cur) < (n)) \
35 size_t o = (b)->re_cur - (b)->re_buf; \
36 size_t a = ((b)->re_end - (b)->re_buf); \
40 if (!((b)->re_buf = alloc(p->env->disc, (b)->re_buf, a))) \
42 (b)->re_buf = (b)->re_cur = (b)->re_end = 0; \
46 (b)->re_cur = (b)->re_buf + o; \
47 (b)->re_end = (b)->re_buf + a; \
51 #define PUTC(p,b,x,r) \ argument
54 NEED(p, b, 1, r); \
55 *(b)->re_cur++ = (x); \
58 #define PUTS(p,b,x,z,r) \ argument
61 NEED(p, b, z, r); \
62 memcpy((b)->re_cur, x, z); \
63 (b)->re_cur += (z); \
71 sub(const regex_t* p, register regsub_t* b, const char* ss, register regsubop_t* op, size_t nmatch,… in sub() argument
92 NEED(p, b, e - s, return c); in sub()
101 *b->re_cur++ = c; in sub()
110 *b->re_cur++ = c; in sub()
121 *b->re_cur++ = c; in sub()
126 *b->re_cur++ = *s++; in sub()
131 NEED(p, b, op->len, return c); in sub()
132 s = b->re_rhs + op->off; in sub()
135 *b->re_cur++ = *s++; in sub()
151 register regsub_t* b; in regsubexec() local
157 b = p->re_sub; in regsubexec()
158 m = b->re_min; in regsubexec()
159 b->re_cur = b->re_buf; in regsubexec()
165 PUTS(p, b, s, match->rm_eo, return fatal(p->env->disc, c, NiL)); in regsubexec()
168 PUTS(p, b, s, match->rm_so, return fatal(p->env->disc, c, NiL)); in regsubexec()
169 if (!c && (c = sub(p, b, s, b->re_ops, nmatch, match))) in regsubexec()
173 if (m <= 0 && !(b->re_flags & REG_SUB_ALL) || !*s) in regsubexec()
190 PUTC(p, b, c, return fatal(p->env->disc, c, NiL)); in regsubexec()
192 NEED(p, b, 1, return fatal(p->env->disc, c, NiL)); in regsubexec()
193 *b->re_cur = 0; in regsubexec()
194 b->re_len = b->re_cur - b->re_buf; in regsubexec()