perl 4.0.00: (no release announcement available)
[p5sagit/p5-mst-13.2.git] / hash.h
CommitLineData
fe14fcc3 1/* $Header: hash.h,v 4.0 91/03/20 01:22:38 lwall Locked $
a687059c 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.
8d063cd8 7 *
8 * $Log: hash.h,v $
fe14fcc3 9 * Revision 4.0 91/03/20 01:22:38 lwall
10 * 4.0 baseline.
8d063cd8 11 *
12 */
13
a687059c 14#define FILLPCT 80 /* don't make greater than 99 */
15#define DBM_CACHE_MAX 63 /* cache 64 entries for dbm file */
16 /* (resident array acts as a write-thru cache)*/
8d063cd8 17
154e51a4 18#define COEFFSIZE (16 * 8) /* size of coeff array */
8d063cd8 19
20typedef struct hentry HENT;
21
22struct hentry {
23 HENT *hent_next;
24 char *hent_key;
25 STR *hent_val;
26 int hent_hash;
a687059c 27 int hent_klen;
8d063cd8 28};
29
30struct htbl {
31 HENT **tbl_array;
a687059c 32 int tbl_max; /* subscript of last element of tbl_array */
33 int tbl_dosplit; /* how full to get before splitting */
34 int tbl_fill; /* how full tbl_array currently is */
8d063cd8 35 int tbl_riter; /* current root of iterator */
36 HENT *tbl_eiter; /* current entry of iterator */
a687059c 37 SPAT *tbl_spatroot; /* list of spats for this package */
d9d8d8de 38 char *tbl_name; /* name, if a symbol table */
a687059c 39#ifdef SOME_DBM
fe14fcc3 40#ifdef HAS_GDBM
41 GDBM_FILE tbl_dbm;
42#else
43#ifdef HAS_NDBM
a687059c 44 DBM *tbl_dbm;
45#else
46 int tbl_dbm;
47#endif
48#endif
fe14fcc3 49#endif
a687059c 50 unsigned char tbl_coeffsize; /* is 0 for symbol tables */
8d063cd8 51};
52
53STR *hfetch();
54bool hstore();
378cc40b 55STR *hdelete();
8d063cd8 56HASH *hnew();
378cc40b 57void hclear();
378cc40b 58void hentfree();
8d063cd8 59int hiterinit();
60HENT *hiternext();
61char *hiterkey();
62STR *hiterval();
a687059c 63bool hdbmopen();
64void hdbmclose();
65bool hdbmstore();