From 8e14a3e06d42b0302868dc3911a2e607e42a51b3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:59:13 +0930 Subject: tdb2: unify tdb1_check and tdb1_summary into tdb_check and tdb_summary. Switch on the TDB_VERSION1 flag. Also, change tdb1_check's checkfn argument to return an error code (and set tdb->last_error accordingly). Signed-off-by: Rusty Russell (Imported from CCAN commit ef92843f2c74ab9d4fa7f167a2182e5e8955df91) --- lib/tdb2/private.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/tdb2/private.h') diff --git a/lib/tdb2/private.h b/lib/tdb2/private.h index 67bc97dad1..816d5f70f8 100644 --- a/lib/tdb2/private.h +++ b/lib/tdb2/private.h @@ -643,6 +643,12 @@ struct tdb_context { #define TDB1_BYTEREV(x) (((((x)&0xff)<<24)|((x)&0xFF00)<<8)|(((x)>>8)&0xFF00)|((x)>>24)) +/* tdb1_check.c: */ +int tdb1_check(struct tdb_context *tdb, + enum TDB_ERROR (*check)(TDB_DATA key, TDB_DATA data, void *), + void *private_data); + + /* tdb1_open.c: */ int tdb1_new_database(struct tdb_context *tdb, struct tdb_attribute_tdb1_hashsize *hashsize); @@ -670,6 +676,9 @@ int tdb1_traverse(struct tdb_context *tdb, int (*)(struct tdb_context *, TDB_DATA, TDB_DATA, void *), void *private_data); +/* tdb1_summary.c: */ +char *tdb1_summary(struct tdb_context *tdb); + /* tdb1_tdb.c: */ int tdb1_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag); enum TDB_ERROR tdb1_fetch(struct tdb_context *tdb, TDB_DATA key, -- cgit