aboutsummaryrefslogtreecommitdiff
path: root/htable.h
blob: e3a75ffbb0ea9ef24c8fc7c98c49d84c84075081 (plain)
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
#ifndef HTABLE_H
#define HTABLE_H

#include <stdlib.h>

struct htable_entry
{
    char *id;
    char *word;
};

struct htable
{
    size_t size;
    size_t max;
    struct htable_entry **elems;
};


int htable_put(struct htable *htable, struct htable_entry *entry);
struct htable_entry *htable_get(struct htable *htable, const char *id);
void htable_init(struct htable *htable, size_t max);
void htable_deinit(struct htable *htable);

#endif