hashtables

This commit is contained in:
Matheus
2022-07-29 18:27:50 -03:00
parent a398c0b523
commit f8d0c13520
5 changed files with 155 additions and 2 deletions
+23
View File
@@ -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