hash/hashtable.h
2024-06-29 03:37:51 +05:00

31 lines
542 B
C

#include <stdlib.h>
#include <stdbool.h>
typedef struct {
bool exists;
size_t sizet;
} size_t_optional;
typedef struct {
char* name;
void* data;
} hashtable_item;
typedef struct {
size_t capacity;
size_t filled;
hashtable_item* items;
} hashtable;
hashtable* hashtable_create(void);
void hashtable_destroy(hashtable*);
size_t_optional hashtable_key(hashtable*, char*);
size_t hashtable_insert(hashtable*, char*);
void* hashtable_get(hashtable* table, char* name);
void hashtable_set(hashtable* table, char* name, void* data);