2 * Sherlock Library -- Fast Buffered I/O on Static Buffers
4 * (c) 2003 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include "lib/fastbuf.h"
14 fbbuf_refill(struct fastbuf *f UNUSED)
20 fbbuf_init_read(struct fastbuf *f, byte *buf, uns size)
22 f->buffer = f->bptr = buf;
23 f->bstop = f->bufend = buf + size;
24 f->name = "fbbuf-read";
26 f->refill = fbbuf_refill;
34 fbbuf_spout(struct fastbuf *f UNUSED)
36 die("fbbuf: buffer overflow on write");
40 fbbuf_init_write(struct fastbuf *f, byte *buf, uns size)
42 f->buffer = f->bstop = f->bptr = buf;
43 f->bufend = buf + size;
44 f->name = "fbbuf-write";
47 f->spout = fbbuf_spout;