Lines Matching refs:buf

75       fs->buf = (char *) malloc (INIT_BUF_SIZE);
76 if (! fs->buf)
83 fs->p = fs->buf;
84 fs->end = fs->buf + INIT_BUF_SIZE;
102 if (fs->p > fs->buf)
105 __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
107 fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
110 free (fs->buf);
126 char *buf, *nl;
130 buf = fs->buf + fs->point_offs;
131 while (buf < fs->p)
143 memmove (buf + pad, buf, fs->p - buf);
145 memset (buf, ' ', pad); /* Fill in the spaces. */
146 buf += pad; /* Don't bother searching them. */
165 len = fs->p - buf;
166 nl = memchr (buf, '\n', len);
188 else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
193 buf = nl + 1;
206 memmove (buf + (r - fs->point_col), nl, fs->p - nl);
207 fs->p -= buf + (r - fs->point_col) - nl;
210 buf += r + 1; /* Skip full line plus \n. */
231 p = buf + (r + 1 - fs->point_col);
232 while (p >= buf && !isblank ((unsigned char) *p))
236 if (nextline > buf)
239 if (p >= buf)
242 while (p >= buf && isblank ((unsigned char) *p));
249 p = buf + (r + 1 - fs->point_col);
259 buf = nl + 1;
277 if ((nextline == buf + len + 1
289 len = nextline + mv - buf;
297 (int) (nl - fs->buf), fs->buf);
299 if (nl > fs->buf)
300 fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
304 len += buf - fs->buf;
305 nl = buf = fs->buf;
314 || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
330 memmove (nl, nextline, buf + len - nextline);
331 len -= nextline - buf;
334 buf = nl;
347 fs->point_offs = fs->p - fs->buf;
364 __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
365 wrote = fs->p - fs->buf;
367 wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
369 if (wrote == fs->p - fs->buf)
371 fs->p = fs->buf;
378 memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
382 if ((size_t) (fs->end - fs->buf) < amount)
385 size_t old_size = fs->end - fs->buf;
389 if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
395 fs->buf = new_buf;
397 fs->p = fs->buf;