perl 3.0 patch #22 patch #19, continued
[p5sagit/p5-mst-13.2.git] / hash.h
1 /* $Header: hash.h,v 3.0.1.1 90/08/09 03:51:34 lwall Locked $
2  *
3  *    Copyright (c) 1989, Larry Wall
4  *
5  *    You may distribute under the terms of the GNU General Public License
6  *    as specified in the README file that comes with the perl 3.0 kit.
7  *
8  * $Log:        hash.h,v $
9  * Revision 3.0.1.1  90/08/09  03:51:34  lwall
10  * patch19: various MSDOS and OS/2 patches folded in
11  * 
12  * Revision 3.0  89/10/18  15:18:39  lwall
13  * 3.0 baseline
14  * 
15  */
16
17 #define FILLPCT 80              /* don't make greater than 99 */
18 #define DBM_CACHE_MAX 63        /* cache 64 entries for dbm file */
19                                 /* (resident array acts as a write-thru cache)*/
20
21 #define COEFFSIZE (16 * 8)      /* size of coeff array */
22
23 typedef struct hentry HENT;
24
25 struct hentry {
26     HENT        *hent_next;
27     char        *hent_key;
28     STR         *hent_val;
29     int         hent_hash;
30     int         hent_klen;
31 };
32
33 struct htbl {
34     HENT        **tbl_array;
35     int         tbl_max;        /* subscript of last element of tbl_array */
36     int         tbl_dosplit;    /* how full to get before splitting */
37     int         tbl_fill;       /* how full tbl_array currently is */
38     int         tbl_riter;      /* current root of iterator */
39     HENT        *tbl_eiter;     /* current entry of iterator */
40     SPAT        *tbl_spatroot;  /* list of spats for this package */
41 #ifdef SOME_DBM
42 #ifdef NDBM
43     DBM         *tbl_dbm;
44 #else
45     int         tbl_dbm;
46 #endif
47 #endif
48     unsigned char tbl_coeffsize;        /* is 0 for symbol tables */
49 };
50
51 STR *hfetch();
52 bool hstore();
53 STR *hdelete();
54 HASH *hnew();
55 void hclear();
56 void hentfree();
57 int hiterinit();
58 HENT *hiternext();
59 char *hiterkey();
60 STR *hiterval();
61 bool hdbmopen();
62 void hdbmclose();
63 bool hdbmstore();