urcu-ht: add correct hash, implement delete_all
[urcu.git] / urcu-ht.h
1 #ifndef _URCU_HT_H
2 #define _URCU_HT_H
3
4 #include <stdint.h>
5
6 typedef uint32_t (*ht_hash_fct)(void *key);
7
8 /*
9 * init_size must be power of two.
10 */
11 struct rcu_ht *ht_new(ht_hash_fct hash_fct, void (*free_fct)(void *data),
12 unsigned long init_size);
13
14 void ht_delete_all(struct rcu_ht *ht);
15
16 void ht_destroy(struct rcu_ht *ht);
17
18 void *ht_lookup(struct rcu_ht *ht, void *key);
19
20 int ht_add(struct rcu_ht *ht, void *key, void *data);
21
22 int ht_delete(struct rcu_ht *ht, void *key);
23
24 void *ht_steal(struct rcu_ht *ht, void *key);
25
26 uint32_t ht_jhash(void *key, u32 length, u32 initval);
27
28 #endif /* _URCU_HT_H */
This page took 0.042889 seconds and 5 git commands to generate.