blob: 54c049755795b44932076702e82e5e769523de6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef HT_H
#define HT_H
#include "util.h"
enum { HT_INIT_CAP = 257 };
typedef struct ht_s ht;
ht *new_ht(UNUM size);
void destroy_ht(ht * restrict htp, int flag);
BOOL ht_insert(ht *htp, NUM key, void *value);
/* This is just for the completeness. In theory I do not need to
delete keys.
If FLAG is non-zero, also free the value pointer. */
BOOL ht_delete(ht * const restrict htp, NUM key, int flag);
void *ht_find(ht * const restrict htp, NUM key);
#endif
|