diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 21:28:11 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 21:28:11 +0100 |
commit | 8bfbc4b05b219950e3eb8ac377b8cb3020ddb9ab (patch) | |
tree | d6dc0ff3158e2531820d323ceb925c79b5d99425 /src/common/include | |
parent | f90436dd7415354105a27846e587adefaea7ef63 (diff) | |
download | kogata-8bfbc4b05b219950e3eb8ac377b8cb3020ddb9ab.tar.gz kogata-8bfbc4b05b219950e3eb8ac377b8cb3020ddb9ab.zip |
Work on nullfs
Diffstat (limited to 'src/common/include')
-rw-r--r-- | src/common/include/hashtbl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/include/hashtbl.h b/src/common/include/hashtbl.h index 3b5a44d..ecac0a8 100644 --- a/src/common/include/hashtbl.h +++ b/src/common/include/hashtbl.h @@ -19,14 +19,14 @@ typedef struct hashtbl hashtbl_t; typedef size_t hash_t; typedef hash_t (*hash_fun_t)(const void*); typedef bool (*key_eq_fun_t)(const void*, const void*); -typedef void (*key_free_fun_t)(void*); +typedef void (*free_fun_t)(void*); -hashtbl_t* create_hashtbl(key_eq_fun_t ef, hash_fun_t hf, key_free_fun_t ff, size_t initial_size); // 0 -> default size -void delete_hashtbl(hashtbl_t* ht); +hashtbl_t* create_hashtbl(key_eq_fun_t ef, hash_fun_t hf, free_fun_t key_ff, size_t initial_size); // 0 -> default size +void delete_hashtbl(hashtbl_t* ht, free_fun_t data_free_fun); -int hashtbl_add(hashtbl_t* ht, void* key, void* v); // non-null on error (OOM for instance) -void* hashtbl_find(hashtbl_t* ht, void* key); // null when not found -void hashtbl_remove(hashtbl_t* ht, void* key); +bool hashtbl_add(hashtbl_t* ht, void* key, void* v); // true = ok, false on error (OOM for instance) +void* hashtbl_find(hashtbl_t* ht, const void* key); // null when not found +void hashtbl_remove(hashtbl_t* ht, const void* key); size_t hashtbl_count(hashtbl_t* ht); hash_t id_hash_fun(const void* v); |