]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.c
As usually, stuff in lib/* is LGPL'ed.
[libucw.git] / lib / fastbuf.c
index 9f5d36924da5dbbbb88e1b76227d96c6d0bcb694..013c1b0848d3453672c38828c24bc91a4a8d09c4 100644 (file)
@@ -288,7 +288,7 @@ bgets0(struct fastbuf *f, byte *b, uns l)
 }
 
 int
-bdirect_read(struct fastbuf *f, byte **buf)
+bdirect_read_prepare(struct fastbuf *f, byte **buf)
 {
   int len;
 
@@ -296,10 +296,15 @@ bdirect_read(struct fastbuf *f, byte **buf)
     return EOF;
   *buf = f->bptr;
   len = f->bstop - f->bptr;
-  f->bptr += len;
   return len;
 }
 
+void
+bdirect_read_commit(struct fastbuf *f, byte *pos)
+{
+  f->bptr = pos;
+}
+
 int
 bdirect_write_prepare(struct fastbuf *f, byte **buf)
 {