diff options
author | Daniel Lange <DLange@git.local> | 2021-01-11 20:43:27 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-01-11 20:43:27 +0100 |
commit | c55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (patch) | |
tree | d6be9a09fdf7d6dc155de3429a70697ee2bb43b0 /Hashtable.h | |
parent | 65357c8c46154de4e4eca14075bfe5523bb5fc14 (diff) | |
download | debian_htop-c55320e9e2a8916e911bcd39ab37b79e3a7d03b2.tar.gz debian_htop-c55320e9e2a8916e911bcd39ab37b79e3a7d03b2.tar.bz2 debian_htop-c55320e9e2a8916e911bcd39ab37b79e3a7d03b2.zip |
New upstream version 3.0.5upstream/3.0.5
Diffstat (limited to 'Hashtable.h')
-rw-r--r-- | Hashtable.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/Hashtable.h b/Hashtable.h index 6d93478..d6b7be2 100644 --- a/Hashtable.h +++ b/Hashtable.h @@ -8,44 +8,34 @@ in the source distribution for its full text. */ #include <stdbool.h> +#include <stddef.h> -typedef unsigned int hkey_t; +typedef unsigned int ht_key_t; -typedef void(*Hashtable_PairFunction)(hkey_t key, void* value, void* userdata); +typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata); -typedef struct HashtableItem_ { - hkey_t key; - unsigned int probe; - void* value; -} HashtableItem; - -typedef struct Hashtable_ { - unsigned int size; - HashtableItem* buckets; - unsigned int items; - bool owner; -} Hashtable; +typedef struct Hashtable_ Hashtable; #ifndef NDEBUG -unsigned int Hashtable_count(const Hashtable* this); +size_t Hashtable_count(const Hashtable* this); #endif /* NDEBUG */ -Hashtable* Hashtable_new(unsigned int size, bool owner); +Hashtable* Hashtable_new(size_t size, bool owner); void Hashtable_delete(Hashtable* this); void Hashtable_clear(Hashtable* this); -void Hashtable_setSize(Hashtable* this, unsigned int size); +void Hashtable_setSize(Hashtable* this, size_t size); -void Hashtable_put(Hashtable* this, hkey_t key, void* value); +void Hashtable_put(Hashtable* this, ht_key_t key, void* value); -void* Hashtable_remove(Hashtable* this, hkey_t key); +void* Hashtable_remove(Hashtable* this, ht_key_t key); -void* Hashtable_get(Hashtable* this, hkey_t key); +void* Hashtable_get(Hashtable* this, ht_key_t key); void Hashtable_foreach(Hashtable* this, Hashtable_PairFunction f, void* userData); |