From: Rusty Russell Date: Tue, 1 Mar 2011 12:49:19 +0000 (+1030) Subject: tdb2: remove tdb_hashfn_t prototype X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=52c4843176ce73484dd405261d13048bcd1b85e5 tdb2: remove tdb_hashfn_t prototype It doesn't help the user, since they can't use it to declare their hash function, and it just adds a level of mental indirection for us. --- diff --git a/ccan/tdb2/private.h b/ccan/tdb2/private.h index d32c7546..69fd40fc 100644 --- a/ccan/tdb2/private.h +++ b/ccan/tdb2/private.h @@ -338,7 +338,7 @@ struct tdb_context { void *log_private; /* Hash function. */ - tdb_hashfn_t khash; + uint64_t (*khash)(const void *key, size_t len, uint64_t seed, void *); void *hash_priv; uint64_t hash_seed; diff --git a/ccan/tdb2/tdb2.h b/ccan/tdb2/tdb2.h index b482d2d6..5e354dfe 100644 --- a/ccan/tdb2/tdb2.h +++ b/ccan/tdb2/tdb2.h @@ -78,8 +78,6 @@ struct tdb_context; /* FIXME: Make typesafe */ typedef int (*tdb_traverse_func)(struct tdb_context *, TDB_DATA, TDB_DATA, void *); -typedef uint64_t (*tdb_hashfn_t)(const void *key, size_t len, uint64_t seed, - void *priv); enum tdb_attribute_type { TDB_ATTRIBUTE_LOG = 0, @@ -104,7 +102,8 @@ struct tdb_attribute_log { struct tdb_attribute_hash { struct tdb_attribute_base base; /* .attr = TDB_ATTRIBUTE_HASH */ - tdb_hashfn_t hash_fn; + uint64_t (*hash_fn)(const void *key, size_t len, uint64_t seed, + void *priv); void *hash_private; };