1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#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 */
|