X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ftdb.h;h=070f09b4e19075e05f7bdfebff634d93fddcc89d;hp=455cde4369951ec5642c14175d56aac563e4741a;hb=1c7178a0a9173ff99a581475d8a9089deadcccb2;hpb=d117f992bde6b7157a8eecbce8a026f2aa7ab4ae diff --git a/ccan/tdb/tdb.h b/ccan/tdb/tdb.h index 455cde43..070f09b4 100644 --- a/ccan/tdb/tdb.h +++ b/ccan/tdb/tdb.h @@ -57,6 +57,7 @@ extern "C" { #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 */ +#define TDB_INCOMPATIBLE_HASH 2048 /* Better hashing: can't be opened by older tdb versions. */ /* error codes */ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, @@ -64,6 +65,9 @@ enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY, TDB_ERR_NESTING}; +/* flags for tdb_summary. Logical or to combine. */ +enum tdb_summary_flags { TDB_SUMMARY_HISTOGRAMS = 1 }; + /* debugging uses one of the following levels */ enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR, TDB_DEBUG_WARNING, TDB_DEBUG_TRACE}; @@ -174,6 +178,7 @@ 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_freelist_size(struct tdb_context *tdb); +char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags); extern TDB_DATA tdb_null;