]> git.ozlabs.org Git - ccan/blob - ccan/ccan_tokenizer/dict.h
tdb2: begin tdb1 to tdb2 porting guide.
[ccan] / ccan / ccan_tokenizer / dict.h
1 #ifndef CCAN_TOKENIZER_DICT_H
2 #define CCAN_TOKENIZER_DICT_H
3
4 #include <stdint.h>
5 #include <ccan/talloc/talloc.h>
6         //needed for freeing the struct dict*
7
8 struct dict_entry {
9         int id;
10         const char *str;
11 };
12
13 struct dict {
14         struct dict_entry *zero;
15         struct dict_entry *by_first_letter[256];
16 };
17
18 struct dict *dict_build(void *ctx, const struct dict_entry *entries, size_t count);
19 struct dict_entry *dict_lookup(struct dict *dict, const char **sp, const char *e);
20
21 #endif