X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb1.h;h=5227bbbbc8edf16ab99ba271ba0c52f169cba253;hp=b2435ba53e3eff8a1f04a2c35220aaf4c54c9fa5;hb=3e46dde21261966941469a6c75e1b45cd2d26324;hpb=8a47d50d72ea62e378dc92b150c92c1317c73fa3 diff --git a/ccan/tdb2/tdb1.h b/ccan/tdb2/tdb1.h index b2435ba5..5227bbbb 100644 --- a/ccan/tdb2/tdb1.h +++ b/ccan/tdb2/tdb1.h @@ -36,28 +36,14 @@ #endif -/** Flags for tdb1_open() */ -#define TDB1_DEFAULT 0 /** just a readability place holder */ -#define TDB1_CLEAR_IF_FIRST 1 /** If this is the first open, wipe the db */ -#define TDB1_INTERNAL 2 /** Don't store on disk */ -#define TDB1_NOLOCK 4 /** Don't do any locking */ -#define TDB1_NOMMAP 8 /** Don't use mmap */ -#define TDB1_CONVERT 16 /** Convert endian (internal use) */ -#define TDB1_BIGENDIAN 32 /** Header is big-endian (internal use) */ -#define TDB1_NOSYNC 64 /** Don't use synchronous transactions */ -#define TDB1_SEQNUM 128 /** Maintain a sequence number */ -#define TDB1_VOLATILE 256 /** Activate the per-hashchain freelist, default 5 */ -#define TDB1_ALLOW_NESTING 512 /** Allow transactions to nest */ -#define TDB1_DISALLOW_NESTING 1024 /** Disallow transactions to nest */ -#define TDB1_INCOMPATIBLE_HASH 2048 /** Better hashing: can't be opened by tdb < 1.2.6. */ - /** This is the context structure that is returned from a db open. */ typedef struct tdb1_context TDB1_CONTEXT; typedef int (*tdb1_traverse_func)(struct tdb1_context *, TDB_DATA, TDB_DATA, void *); typedef void (*tdb1_log_func)(struct tdb1_context *, enum tdb_log_level, enum TDB_ERROR, const char *, void *); -typedef unsigned int (*tdb1_hash_func)(TDB_DATA *key); +typedef uint64_t (*tdb1_hash_func)(const void *key, size_t len, uint64_t seed, + void *data); struct tdb1_logging_context { tdb1_log_func log_fn; @@ -121,7 +107,7 @@ int tdb1_hash_size(struct tdb1_context *tdb); void tdb1_increment_seqnum_nonblock(struct tdb1_context *tdb); -unsigned int tdb1_jenkins_hash(TDB_DATA *key); +uint64_t tdb1_incompatible_hash(const void *key, size_t len, uint64_t seed, void *); int tdb1_check(struct tdb1_context *tdb, int (*check) (TDB_DATA key, TDB_DATA data, void *private_data),