diff options
Diffstat (limited to 'src/core/idhash.h')
| -rw-r--r-- | src/core/idhash.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/core/idhash.h b/src/core/idhash.h index ffc60858..bfd0f595 100644 --- a/src/core/idhash.h +++ b/src/core/idhash.h @@ -23,20 +23,7 @@ // must be non-NULL. The caller is responsible for providing any // locking required. -// In order to make life easy, we just define the ID hash structure -// directly, and let consumers directly inline it. -typedef struct { - uint32_t ihe_key; - void * ihe_val; -} nni_idhash_entry; - -typedef struct { - uint32_t ih_cap; - uint32_t ih_count; - uint32_t ih_mincount; - uint32_t ih_maxcount; - nni_idhash_entry * ih_entries; -} nni_idhash; +typedef struct nni_idhash nni_idhash; // nni_idhash_walkfn is called when walking a hash table. If the // return value is non-zero, then nni_idhash_walk will terminate further @@ -44,8 +31,8 @@ typedef struct { // opaque value for the walk as its first argument, and the next two // arguments are the hash key and the opaque value stored with it. typedef int (*nni_idhash_walkfn)(void *, uint32_t, void *); -extern int nni_idhash_init(nni_idhash *); -extern void nni_idhash_fini(nni_idhash *); +extern int nni_idhash_create(nni_idhash **); +extern void nni_idhash_destroy(nni_idhash *); extern int nni_idhash_find(nni_idhash *, uint32_t, void **); extern int nni_idhash_remove(nni_idhash *, uint32_t); extern int nni_idhash_insert(nni_idhash *, uint32_t, void *); |
