X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffb-mem.c;h=0de590e04fb90b19cca2c567f2c7c338d75b4180;hb=23d048bf93916d08a87b41533012a36e25de3d2f;hp=82fe251e9ec28413e155e7149c85bccac78873fd;hpb=61da975c346c50ccf9bb9cb7271ef538dc15ab32;p=libucw.git diff --git a/lib/fb-mem.c b/lib/fb-mem.c index 82fe251e..0de590e0 100644 --- a/lib/fb-mem.c +++ b/lib/fb-mem.c @@ -1,8 +1,7 @@ /* - * Sherlock Library -- Fast Buffered I/O on Memory Streams + * UCW Library -- Fast Buffered I/O on Memory Streams * * (c) 1997--2002 Martin Mares - * (c) 2004 Robert Spalek * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -11,8 +10,6 @@ #include "lib/lib.h" #include "lib/fastbuf.h" -#include - struct memstream { unsigned blocksize; unsigned uc; @@ -30,7 +27,6 @@ struct fb_mem { struct fastbuf fb; struct memstream *stream; struct msblock *block; - int can_overwrite; }; #define FB_MEM(f) ((struct fb_mem *)(f)->is_fastbuf) @@ -151,21 +147,6 @@ fbmem_close(struct fastbuf *f) xfree(f); } -static int -fbmem_config(struct fastbuf *f, uns item, int value) -{ - switch (item) - { - case BCONFIG_CAN_OVERWRITE: ; - int old_value = FB_MEM(f)->can_overwrite; - if (value >= 0 && value <= 1) - FB_MEM(f)->can_overwrite = value; - return old_value; - default: - return -1; - } -} - struct fastbuf * fbmem_create(unsigned blocksize) { @@ -179,7 +160,6 @@ fbmem_create(unsigned blocksize) f->name = ""; f->spout = fbmem_spout; f->close = fbmem_close; - f->config = fbmem_config; return f; } @@ -197,8 +177,7 @@ fbmem_clone_read(struct fastbuf *b) f->refill = fbmem_refill; f->seek = fbmem_seek; f->close = fbmem_close; - f->config = fbmem_config; - FB_MEM(f)->can_overwrite = 1; + f->can_overwrite_buffer = 1; return f; }