Commit | Line | Data |
---|---|---|
378cc40b | 1 | /* $Header: hash.h,v 2.0 88/06/05 00:09:08 root Exp $ |
8d063cd8 LW |
2 | * |
3 | * $Log: hash.h,v $ | |
378cc40b LW |
4 | * Revision 2.0 88/06/05 00:09:08 root |
5 | * Baseline version 2.0. | |
8d063cd8 LW |
6 | * |
7 | */ | |
8 | ||
9 | #define FILLPCT 60 /* don't make greater than 99 */ | |
10 | ||
378cc40b | 11 | #define COEFFSIZE (16 * 8) /* size of array below */ |
8d063cd8 LW |
12 | #ifdef DOINIT |
13 | char coeff[] = { | |
14 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
15 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
16 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
17 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
18 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
19 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
20 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1, | |
21 | 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1}; | |
22 | #else | |
23 | extern char coeff[]; | |
24 | #endif | |
25 | ||
26 | typedef struct hentry HENT; | |
27 | ||
28 | struct hentry { | |
29 | HENT *hent_next; | |
30 | char *hent_key; | |
31 | STR *hent_val; | |
32 | int hent_hash; | |
33 | }; | |
34 | ||
35 | struct htbl { | |
36 | HENT **tbl_array; | |
37 | int tbl_max; | |
38 | int tbl_fill; | |
39 | int tbl_riter; /* current root of iterator */ | |
40 | HENT *tbl_eiter; /* current entry of iterator */ | |
41 | }; | |
42 | ||
43 | STR *hfetch(); | |
44 | bool hstore(); | |
378cc40b | 45 | STR *hdelete(); |
8d063cd8 | 46 | HASH *hnew(); |
378cc40b LW |
47 | void hclear(); |
48 | void hfree(); | |
49 | void hentfree(); | |
8d063cd8 LW |
50 | int hiterinit(); |
51 | HENT *hiternext(); | |
52 | char *hiterkey(); | |
53 | STR *hiterval(); |