]> mj.ucw.cz Git - libucw.git/commitdiff
fbbuf_init_read() now has can_overwrite as an extra parameter.
authorMartin Mares <mj@ucw.cz>
Tue, 6 Jul 2004 19:35:46 +0000 (19:35 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 6 Jul 2004 19:35:46 +0000 (19:35 +0000)
lib/fastbuf.h
lib/fb-buffer.c

index 65245b6266720c8a2fab0f7fcbc38bf33bf91509..fadf306135ec7ebe5b490816d7ec871230234a9c 100644 (file)
@@ -100,7 +100,7 @@ struct fastbuf *bopen_limited_fd(int fd, uns bufsize, uns limit);
 
 /* FastIO on static buffers */
 
-void fbbuf_init_read(struct fastbuf *f, byte *buffer, uns size);
+void fbbuf_init_read(struct fastbuf *f, byte *buffer, uns size, uns can_overwrite);
 void fbbuf_init_write(struct fastbuf *f, byte *buffer, uns size);
 static inline uns
 fbbuf_count_written(struct fastbuf *f)
index 8779ef323878df30c544f8eb1251dacc2c0f2ab2..574874f0a11aa2545f29ad5716394324b688f3cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Sherlock Library -- Fast Buffered I/O on Static Buffers
  *
- *     (c) 2003 Martin Mares <mj@ucw.cz>
+ *     (c) 2003--2004 Martin Mares <mj@ucw.cz>
  *
  *     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,7 +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 = 1;
+  f->can_overwrite_buffer = can_overwrite;
 }
 
 static void