]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb.c
tdb2: tdb_name and tdb_fd functions.
[ccan] / ccan / tdb2 / tdb.c
index d3d12250cea8b21f4bf76431957f660796d83dad..79ccd0f1c260cb476b35c146f15a9438f843a673 100644 (file)
@@ -2,9 +2,6 @@
 #include <ccan/asprintf/asprintf.h>
 #include <stdarg.h>
 
-/* The null return. */
-struct tdb_data tdb_null = { .dptr = NULL, .dsize = 0 };
-
 static enum TDB_ERROR update_rec_hdr(struct tdb_context *tdb,
                                     tdb_off_t off,
                                     tdb_len_t keylen,
@@ -431,3 +428,12 @@ enum TDB_ERROR tdb_parse_record_(struct tdb_context *tdb,
        return ecode;
 }
 
+const char *tdb_name(const struct tdb_context *tdb)
+{
+       return tdb->name;
+}
+
+int tdb_fd(const struct tdb_context *tdb)
+{
+       return tdb->file->fd;
+}