Commit | Line | Data |
---|---|---|
8d5530c4 MW |
1 | #ifndef STRSET_H |
2 | #define STRSET_H | |
3 | ||
4 | #include "uint32.h" | |
5 | ||
6 | typedef struct strset_list | |
7 | { | |
8 | uint32 h; | |
9 | int next; | |
10 | } | |
11 | strset_list; | |
12 | ||
13 | typedef struct | |
14 | { | |
15 | int mask; /* mask + 1 is power of 2, size of hash table */ | |
16 | int n; /* number of entries used in list and x */ | |
17 | int a; /* number of entries allocated in list and x */ | |
18 | int *first; /* first[h] is front of hash list h */ | |
19 | strset_list *p; /* p[i].next is next; p[i].h is hash of x[i] */ | |
20 | char **x; /* x[i] is entry i */ | |
21 | } | |
22 | strset; | |
23 | ||
24 | extern uint32 strset_hash(); | |
25 | extern int strset_init(); | |
26 | extern char *strset_in(); | |
27 | extern int strset_add(); | |
28 | ||
29 | #endif |