X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Ffb-mem.c;h=c304e16db0b988b73aaf630ecb0af0fe335fdebf;hb=5dea0be536bd0e658f231efd5631b331a8764e5a;hp=89390f1b6999527fcb3ac86266f6edbd05d0855c;hpb=49edfa12025a3552d1cfcd2a936201c1da95148a;p=libucw.git diff --git a/lib/fb-mem.c b/lib/fb-mem.c index 89390f1b..c304e16d 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,7 +10,7 @@ #include "lib/lib.h" #include "lib/fastbuf.h" -#include +#include struct memstream { unsigned blocksize; @@ -96,7 +95,7 @@ fbmem_spout(struct fastbuf *f) FB_MEM(f)->block = bb; } -static void +static int fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) { struct memstream *m = FB_MEM(f)->stream; @@ -118,7 +117,7 @@ fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) f->bufend = f->bstop = b->data + b->size; f->pos = b->pos + b->size; FB_MEM(f)->block = b; - return; + return 1; } } if (!m->first && !pos) @@ -127,7 +126,7 @@ fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) f->buffer = f->bptr = f->bufend = NULL; f->pos = 0; FB_MEM(f)->block = NULL; - return; + return 1; } die("fbmem_seek to invalid offset"); }