20 ((void *)0xFFFFFFFFFFFFFFFUL)
28typedef const char *(*get_key_func)(
const void *);
void * hash_table_lookup(const hashtable *ht, const char *key)
Looks up an object in the hash table by its string key.
Definition hashtable.c:69
const char *(* get_key_func)(const void *)
Function pointer type for extracting a string key from an object.
Definition hashtable.h:28
void * hash_table_delete(hashtable *ht, const char *key)
Deletes an object from the hash table by its string key.
Definition hashtable.c:87
void init_hash_table(hashtable *ht, get_key_func get_key, size_t size)
Initializes the hash table with a given size.
void free_hash_table(hashtable *ht)
Frees the dynamically allocated table inside the hash table.
Definition hashtable.c:26
void print_table(const hashtable *ht)
Prints the current state of the hash table to the console.
Definition hashtable.c:41
bool hash_table_insert(hashtable *ht, void *item)
Inserts an object into the hash table using linear probing.
Definition hashtable.c:53
The hash table structure.
Definition hashtable.h:37
void ** table
Dynamic array of pointers to stored objects.
Definition hashtable.h:38
get_key_func get_key
Function to extract keys from objects.
Definition hashtable.h:40
size_t size
Number of buckets in the table.
Definition hashtable.h:39