]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/private.h
tdb2: rename ->read and ->write functions.
[ccan] / ccan / tdb2 / private.h
index 09f447f9221d179377d3e25bddae3a45977c49b1..e2982bc5aac6cb49ac5c0118736f5c7b536e94c7 100644 (file)
@@ -37,7 +37,7 @@
 #include <ccan/tdb2/tdb2.h>
 #include <ccan/likely/likely.h>
 #include <ccan/compiler/compiler.h>
-#ifdef HAVE_BYTESWAP_H
+#if HAVE_BYTESWAP_H
 #include <byteswap.h>
 #endif
 
@@ -366,8 +366,8 @@ struct tdb_context {
 };
 
 struct tdb_methods {
-       int (*read)(struct tdb_context *, tdb_off_t, void *, tdb_len_t);
-       int (*write)(struct tdb_context *, tdb_off_t, const void *, tdb_len_t);
+       int (*tread)(struct tdb_context *, tdb_off_t, void *, tdb_len_t);
+       int (*twrite)(struct tdb_context *, tdb_off_t, const void *, tdb_len_t);
        int (*oob)(struct tdb_context *, tdb_off_t, bool);
        int (*expand_file)(struct tdb_context *, tdb_len_t);
        void *(*direct)(struct tdb_context *, tdb_off_t, size_t, bool);
@@ -474,11 +474,6 @@ tdb_off_t tdb_find_nonzero_off(struct tdb_context *tdb,
 tdb_off_t tdb_find_zero_off(struct tdb_context *tdb, tdb_off_t off,
                            uint64_t num);
 
-/* Even on files, we can get partial writes due to signals. */
-bool tdb_pwrite_all(int fd, const void *buf, size_t len, tdb_off_t off);
-bool tdb_pread_all(int fd, void *buf, size_t len, tdb_off_t off);
-bool tdb_read_all(int fd, void *buf, size_t len);
-
 /* Allocate and make a copy of some offset. */
 void *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len);