mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-28 21:28:21 +00:00
hashtables
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef _HASHTABLE_H_INCLUDE
|
||||
#define _HASHTABLE_H_INCLUDE
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct{
|
||||
void* next;
|
||||
char* key;
|
||||
void* val;
|
||||
} hashtableentry;
|
||||
|
||||
typedef struct{
|
||||
size_t size;
|
||||
hashtableentry* entries;
|
||||
} hashtable;
|
||||
|
||||
bool hashtable_init(hashtable*, size_t);
|
||||
bool hashtable_insert(hashtable*, char*, void*);
|
||||
bool hashtable_remove(hashtable*, char*);
|
||||
void* hashtable_get(hashtable*, char*);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user