perl 4.0 patch 10: (combined patch)
[p5sagit/p5-mst-13.2.git] / hash.h
1 /* $RCSfile: hash.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:10:33 $
2  *
3  *    Copyright (c) 1991, Larry Wall
4  *
5  *    You may distribute under the terms of either the GNU General Public
6  *    License or the Artistic License, as specified in the README file.
7  *
8  * $Log:        hash.h,v $
9  * Revision 4.0.1.1  91/06/07  11:10:33  lwall
10  * patch4: new copyright notice
11  * 
12  * Revision 4.0  91/03/20  01:22:38  lwall
13  * 4.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     char        *tbl_name;      /* name, if a symbol table */
42 #ifdef SOME_DBM
43 #ifdef HAS_GDBM
44     GDBM_FILE   tbl_dbm;
45 #else
46 #ifdef HAS_NDBM
47     DBM         *tbl_dbm;
48 #else
49     int         tbl_dbm;
50 #endif
51 #endif
52 #endif
53     unsigned char tbl_coeffsize;        /* is 0 for symbol tables */
54 };
55
56 STR *hfetch();
57 bool hstore();
58 STR *hdelete();
59 HASH *hnew();
60 void hclear();
61 void hentfree();
62 int hiterinit();
63 HENT *hiternext();
64 char *hiterkey();
65 STR *hiterval();
66 bool hdbmopen();
67 void hdbmclose();
68 bool hdbmstore();