]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.h
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / fastbuf.h
index ea71f1206a38c2e40f915d14db7b44c155ec275a..af6787aeaf5cc29a2f3e28856c0aa0cf18d85fab 100644 (file)
@@ -81,6 +81,7 @@ struct fastbuf {
 /* FastIO on standard files (specify buffer size 0 to enable mmaping) */
 
 struct fastbuf *bopen(byte *name, uns mode, uns buflen);
+struct fastbuf *bopen_try(byte *name, uns mode, uns buflen);
 struct fastbuf *bopen_tmp(uns buflen);
 struct fastbuf *bfdopen(int fd, uns buflen);
 struct fastbuf *bfdopen_shared(int fd, uns buflen);
@@ -109,6 +110,12 @@ fbbuf_count_written(struct fastbuf *f)
   return f->bptr - f->bstop;
 }
 
+/* FastIO on recyclable growing buffers */
+
+struct fastbuf *fbgrow_create(unsigned basic_size);
+void fbgrow_reset(struct fastbuf *b);                  /* Reset stream and prepare for writing */
+void fbgrow_rewind(struct fastbuf *b);                 /* Prepare for reading */
+
 /* Configuring stream parameters */
 
 int bconfig(struct fastbuf *f, uns type, int data);
@@ -411,7 +418,7 @@ bdirect_write_commit(struct fastbuf *f, byte *pos)
 
 /* Formatted output */
 
-int bprintf(struct fastbuf *b, byte *msg, ...);
-int vbprintf(struct fastbuf *b, byte *msg, va_list args);
+int bprintf(struct fastbuf *b, char *msg, ...) FORMAT_CHECK(printf,2,3);
+int vbprintf(struct fastbuf *b, char *msg, va_list args);
 
 #endif