a "replacement" for awk and sed
[perl.git] / x2p / hash.h
1 /* $Header: hash.h,v 1.0 87/12/18 13:07:23 root Exp $
2  *
3  * $Log:        hash.h,v $
4  * Revision 1.0  87/12/18  13:07:23  root
5  * Initial revision
6  * 
7  */
8
9 #define FILLPCT 60              /* don't make greater than 99 */
10
11 #ifdef DOINIT
12 char coeff[] = {
13                 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
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 #else
22 extern char coeff[];
23 #endif
24
25 typedef struct hentry HENT;
26
27 struct hentry {
28     HENT        *hent_next;
29     char        *hent_key;
30     STR         *hent_val;
31     int         hent_hash;
32 };
33
34 struct htbl {
35     HENT        **tbl_array;
36     int         tbl_max;
37     int         tbl_fill;
38     int         tbl_riter;      /* current root of iterator */
39     HENT        *tbl_eiter;     /* current entry of iterator */
40 };
41
42 STR *hfetch();
43 bool hstore();
44 bool hdelete();
45 HASH *hnew();
46 int hiterinit();
47 HENT *hiternext();
48 char *hiterkey();
49 STR *hiterval();