#ifndef _HASHTABLE
#define _HASHTABLE

#include "Types.h"
#include "MemoryManager.h"

typedef void* HashTable;

/* Create */

HashTable H_new(MemoryManager *mm, usize size);

/* Free */

Result H_free(HashTable* ht);
Result H_freeat(HashTable ht, const char *key);
Result H_freevals(HashTable* ht);

/* Modify */

Result H_insert(HashTable ht, const char *key, void *value);
Result H_insertstr(HashTable ht, const char *key, const char *value);
Result H_inserti(HashTable ht, const char *key, int value);
Result H_insertf(HashTable ht, const char *key, double value);

/* Get */

usize   H_size(HashTable ht);
usize   H_count(HashTable ht);
void*   H_get(HashTable ht, const char* key);
char*   H_getstr(HashTable ht, const char* key);
int*    H_geti(HashTable ht, const char* key);
double* H_getf(HashTable ht, const char* key);

#endif /* _HASHTABLE */
