diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2024-05-22 13:00:41 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2024-05-22 13:00:41 -0400 |
commit | ace65b453151845bc361f21f3e5b651c35f9f126 (patch) | |
tree | 262ebd29b0ca1d8584f0b6f1efa7a00d9f4f3e43 /lib/hashtable.h | |
parent | f004c1ade8d617a82cea2fe249434cccb47a2358 (diff) | |
download | jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.tar.gz jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.tar.bz2 jove-kernel-ace65b453151845bc361f21f3e5b651c35f9f126.zip |
Diffstat (limited to 'lib/hashtable.h')
-rw-r--r-- | lib/hashtable.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/hashtable.h b/lib/hashtable.h deleted file mode 100644 index fe6f5c3..0000000 --- a/lib/hashtable.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef JOVE_LIB_HASHTABLE_H -#define JOVE_LIB_HASHTABLE_H 1 - -#include <stddef.h> -#include <stdint.h> -#include "linkedlist.h" - -struct HashTableValue -{ - const void *key; - char value[]; -}; - -struct HashTable { - struct SLinkedList *buckets; - size_t bucket_count; - size_t bucket_capacity; - - size_t obj_size; - int key_size; - size_t (*hash_function)(const void*, size_t); -}; - -void _hashtable_new(struct HashTable *table, size_t obj_size, size_t key_size); -#define hashtable_new(table, type, keytype) _hashtable_new(table, sizeof(type), sizeof(keytype)) - -void _hashtable_news(struct HashTable *table, size_t obj_size); -#define hashtable_news(table, type) _hashtable_news(table, sizeof(type)) - -void hashtable_insert(struct HashTable *table, const void *key, void *data); -void *_hashtable_get(struct HashTable *table, const void *key); -#define hashtable_get(table, key, type) (type*)_hashtable_get(table, key) - -#endif |