Browse Source

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.
Rusty Russell 15 years ago
parent
commit
52c4843176
2 changed files with 3 additions and 4 deletions
  1. 1 1
      ccan/tdb2/private.h
  2. 2 3
      ccan/tdb2/tdb2.h

+ 1 - 1
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;
 

+ 2 - 3
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;
 };