X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb2.h;h=f856827fcc8f9997598665643b5a0fb44417cec7;hp=fa0b6ce7d01651f468a08989dcffb88656e6a98c;hb=cd1c68c0d989e6aed401260f92c63db8e8132db5;hpb=ee6f11b307599200a574208372bc962eff81a9b1 diff --git a/ccan/tdb2/tdb2.h b/ccan/tdb2/tdb2.h index fa0b6ce7..f856827f 100644 --- a/ccan/tdb2/tdb2.h +++ b/ccan/tdb2/tdb2.h @@ -57,13 +57,11 @@ extern "C" { #define TDB_SEQNUM 128 /* maintain a sequence number */ #define TDB_VOLATILE 256 /* Activate the per-hashchain freelist, default 5 */ #define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */ -#define TDB_DISALLOW_NESTING 1024 /* Disallow transactions to nest */ /* 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, - TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY, - TDB_ERR_NESTING}; + TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOEXIST, + TDB_ERR_EINVAL, TDB_ERR_RDONLY, TDB_ERR_NESTING }; /* debugging uses one of the following levels */ enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR, @@ -135,12 +133,15 @@ int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key); int64_t tdb_traverse(struct tdb_context *tdb, tdb_traverse_func fn, void *p); int64_t tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *p); +TDB_DATA tdb_firstkey(struct tdb_context *tdb); +TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key); int tdb_close(struct tdb_context *tdb); int tdb_check(struct tdb_context *tdb, int (*check)(TDB_DATA key, TDB_DATA data, void *private_data), void *private_data); enum TDB_ERROR tdb_error(struct tdb_context *tdb); +const char *tdb_errorstr(struct tdb_context *tdb); extern struct tdb_data tdb_null;