Lines Matching refs:off
168 int off = 0; in substitute_matching_text() local
186 REALLOC(rbuf, rbufsz, off + i, ERR); in substitute_matching_text()
189 memcpy(rbuf + off, txt, i); in substitute_matching_text()
190 off += i; in substitute_matching_text()
191 if ((off = apply_subst_template(txt, rm, off, in substitute_matching_text()
196 REALLOC(rbuf, rbufsz, off + i, ERR); in substitute_matching_text()
199 memcpy(rbuf + off, txt, i); in substitute_matching_text()
200 off += i; in substitute_matching_text()
207 REALLOC(rbuf, rbufsz, off + i + 2, ERR); in substitute_matching_text()
214 memcpy(rbuf + off, txt, i); in substitute_matching_text()
215 memcpy(rbuf + off + i, "\n", 2); in substitute_matching_text()
217 return changed ? off + i + 1 : 0; in substitute_matching_text()
224 apply_subst_template(const char *boln, regmatch_t *rm, int off, int re_nsub) in apply_subst_template() argument
235 REALLOC(rbuf, rbufsz, off + k - j, ERR); in apply_subst_template()
237 rbuf[off++] = boln[j++]; in apply_subst_template()
242 REALLOC(rbuf, rbufsz, off + k - j, ERR); in apply_subst_template()
244 rbuf[off++] = boln[j++]; in apply_subst_template()
246 REALLOC(rbuf, rbufsz, off + 1, ERR); in apply_subst_template()
247 rbuf[off++] = *sub; in apply_subst_template()
249 REALLOC(rbuf, rbufsz, off + 1, ERR); in apply_subst_template()
250 rbuf[off] = '\0'; in apply_subst_template()
251 return off; in apply_subst_template()