X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Ffb-buffer.c;h=b06088e0c3a028e6167a4f78a23887ecfd42cb31;hb=6a26177ec0df11f55bff590d63ea02e7c9884993;hp=2e2d44541ff9cd87333baa85dd224e66fe3bcf72;hpb=f185581ca3237ec1c37bc4ad92aab4c3ce8e7236;p=libucw.git diff --git a/lib/fb-buffer.c b/lib/fb-buffer.c index 2e2d4454..b06088e0 100644 --- a/lib/fb-buffer.c +++ b/lib/fb-buffer.c @@ -1,7 +1,7 @@ /* - * Sherlock Library -- Fast Buffered I/O on Static Buffers + * UCW Library -- Fast Buffered I/O on Static Buffers * - * (c) 2003 Martin Mares + * (c) 2003--2004 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -17,7 +17,7 @@ fbbuf_refill(struct fastbuf *f UNUSED) } void -fbbuf_init_read(struct fastbuf *f, byte *buf, uns size) +fbbuf_init_read(struct fastbuf *f, byte *buf, uns size, uns can_overwrite) { f->buffer = f->bptr = buf; f->bstop = f->bufend = buf + size; @@ -28,6 +28,7 @@ fbbuf_init_read(struct fastbuf *f, byte *buf, uns size) f->seek = NULL; f->close = NULL; f->config = NULL; + f->can_overwrite_buffer = can_overwrite; } static void @@ -36,18 +37,6 @@ fbbuf_spout(struct fastbuf *f UNUSED) die("fbbuf: buffer overflow on write"); } -static int -fbbuf_config(struct fastbuf *f UNUSED, uns item, int value UNUSED) -{ - switch (item) - { - case BCONFIG_CAN_OVERWRITE: - return 1; - default: - return -1; - } -} - void fbbuf_init_write(struct fastbuf *f, byte *buf, uns size) { @@ -59,5 +48,6 @@ fbbuf_init_write(struct fastbuf *f, byte *buf, uns size) f->spout = fbbuf_spout; f->seek = NULL; f->close = NULL; - f->config = fbbuf_config; + f->config = NULL; + f->can_overwrite_buffer = 0; }