summaryrefslogtreecommitdiff
path: root/hashtable.h
blob: be459647ae0bb5bbb9856f88b0328537352f2434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef HASHTABLE
#define HASHTABLE

typedef struct HashPair {
	char* key;
	void* value;
} pair_t;
typedef struct HashTable {
	pair_t** pairs;
	int capacity;
	int itemCount;
} hashtable_t;
unsigned int get_hash(char* str);
hashtable_t* init_hashtable(unsigned int capacity);
unsigned int hashtable_add_pair(hashtable_t* hashtable, pair_t pair);
pair_t* hashtable_get_pair(hashtable_t* hashtable, char* key);

#endif