#ifndef _URCU_HT_H
#define _URCU_HT_H
-#define HASH_SIZE 4096
-typedef unsigned long (*ht_hash_fct)(void *key);
+#include <stdint.h>
-struct rcu_ht *ht_new(ht_hash_fct hash_fct, void (*free_fct)(void *data));
+/*
+ * Caution !
+ * Ensure writer threads are registered as urcu readers and with with
+ * urcu-defer.
+ * Ensure reader threads are registered as urcu readers.
+ */
-void ht_delete_all(struct rcu_ht *ht);
+typedef uint32_t (*ht_hash_fct)(void *key, uint32_t length, uint32_t initval);
-void ht_destroy(struct rcu_ht *ht);
+/*
+ * init_size must be power of two.
+ */
+struct rcu_ht *ht_new(ht_hash_fct hash_fct, void (*free_fct)(void *data),
+ unsigned long init_size, uint32_t keylen,
+ uint32_t hashseed);
+
+int ht_delete_all(struct rcu_ht *ht);
+
+int ht_destroy(struct rcu_ht *ht);
void *ht_lookup(struct rcu_ht *ht, void *key);
void *ht_steal(struct rcu_ht *ht, void *key);
-unsigned long stupid_hash(void *key);
+uint32_t ht_jhash(void *key, uint32_t length, uint32_t initval);
#endif /* _URCU_HT_H */