upscheme/c/htable.h

18 lines
387 B
C
Raw Normal View History

#define HT_N_INLINE 32
2019-08-09 12:26:09 -04:00
struct htable {
size_t size;
void **table;
void *_space[HT_N_INLINE];
2019-08-09 12:26:09 -04:00
};
// define this to be an invalid key/value
#define HT_NOTFOUND ((void *)1)
// initialize and free
2019-08-09 12:26:09 -04:00
struct htable *htable_new(struct htable *h, size_t size);
void htable_free(struct htable *h);
// clear and (possibly) change size
2019-08-09 12:26:09 -04:00
void htable_reset(struct htable *h, size_t sz);