]> 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 26d829ab8834977e56b69958c9802890318fbf6e..abcf7118499f0a76a66b5ab1b4a0aa3e11f03e1f 100644 (file)
@@ -19,7 +19,6 @@
 #include <alloca.h>
 
 #include "lib/unaligned.h"
-#include "lib/bbuf.h"
 
 /*
  *  Generic buffered I/O. You supply hooks to be called for low-level operations
@@ -89,6 +88,9 @@ struct fastbuf *bfdopen(int fd, uns buflen);
 struct fastbuf *bfdopen_shared(int fd, uns buflen);
 void bfilesync(struct fastbuf *b);
 
+#define TEMP_FILE_NAME_LEN 256
+void temp_file_name(byte *name);
+
 /* FastIO on in-memory streams */
 
 struct fastbuf *fbmem_create(unsigned blocksize);      /* Create stream and return its writing fastbuf */
@@ -98,6 +100,14 @@ struct fastbuf *fbmem_clone_read(struct fastbuf *); /* Create reading fastbuf */
 
 struct fastbuf *bopen_mm(byte *name, uns mode);
 
+/* FastIO on files opened with O_DIRECT (see fb-direct.c for description) */
+
+struct asio_queue;
+struct fastbuf *fbdir_open(byte *name, uns mode, struct asio_queue *io_queue);
+struct fastbuf *fbdir_open_try(byte *name, uns mode, struct asio_queue *io_queue);
+struct fastbuf *fbdir_open_fd(int fd, struct asio_queue *io_queue);
+struct fastbuf *fbdir_open_tmp(struct asio_queue *io_queue);
+
 /* FastI on file descriptors with limit */
 
 struct fastbuf *bopen_limited_fd(int fd, uns bufsize, uns limit);
@@ -342,7 +352,8 @@ int bgets_nodie(struct fastbuf *f, byte *b, uns l);
 byte *bgets0(struct fastbuf *f, byte *b, uns l);
 
 struct mempool;
-uns bgets_bb(struct fastbuf *f, bb_t *b, uns limit);
+struct bb_t;
+uns bgets_bb(struct fastbuf *f, struct bb_t *b, uns limit);
 byte *bgets_mp(struct fastbuf *f, struct mempool *mp);
 
 struct bgets_stk_struct {