X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb%2Ftdb.h;h=5ab724031dc5bebeccc920bfc6142a542bb39bc0;hb=67aef98e2e4409b69ba668a2a4a9f0757ddc7ca7;hp=43282e57ff8e824a80fdb784d53ab640c051cac3;hpb=03c1876179e48121ab2bb445053fcb8371f36e5e;p=ccan diff --git a/ccan/tdb/tdb.h b/ccan/tdb/tdb.h index 43282e57..5ab72403 100644 --- a/ccan/tdb/tdb.h +++ b/ccan/tdb/tdb.h @@ -57,8 +57,6 @@ extern "C" { #define TDB_VOLATILE 256 /* Activate the per-hashchain freelist, default 5 */ #define TDB_NO_NESTING 512 /* Dont allow transaction nesting */ -#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret) - /* error codes */ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT, @@ -161,11 +159,14 @@ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key); void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *sigptr); +/* wipe and repack */ +int tdb_wipe_all(struct tdb_context *tdb); +int tdb_repack(struct tdb_context *tdb); + /* Debug functions. Not used in production. */ void tdb_dump_all(struct tdb_context *tdb); int tdb_printfreelist(struct tdb_context *tdb); int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries); -int tdb_wipe_all(struct tdb_context *tdb); int tdb_freelist_size(struct tdb_context *tdb); extern TDB_DATA tdb_null;