]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.h
Creation of temporary files is now thread-safe (ugh).
[libucw.git] / lib / fastbuf.h
index 922798ff183515a3d102191c6e614569373088e1..27f0f584cefc28143d275e63be00a4bbcc7ae8fb 100644 (file)
@@ -88,6 +88,9 @@ struct fastbuf *bfdopen(int fd, uns buflen);
 struct fastbuf *bfdopen_shared(int fd, uns buflen);
 void bfilesync(struct fastbuf *b);
 
 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 */
 /* FastIO on in-memory streams */
 
 struct fastbuf *fbmem_create(unsigned blocksize);      /* Create stream and return its writing fastbuf */
@@ -97,6 +100,14 @@ struct fastbuf *fbmem_clone_read(struct fastbuf *); /* Create reading fastbuf */
 
 struct fastbuf *bopen_mm(byte *name, uns mode);
 
 
 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(int fd, struct asio_queue *io_queue);
+
 /* FastI on file descriptors with limit */
 
 struct fastbuf *bopen_limited_fd(int fd, uns bufsize, uns limit);
 /* FastI on file descriptors with limit */
 
 struct fastbuf *bopen_limited_fd(int fd, uns bufsize, uns limit);