perl 3.0 patch #26 patch #19, continued
[p5sagit/p5-mst-13.2.git] / hash.h
CommitLineData
154e51a4 1/* $Header: hash.h,v 3.0.1.1 90/08/09 03:51:34 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 $
154e51a4 9 * Revision 3.0.1.1 90/08/09 03:51:34 lwall
10 * patch19: various MSDOS and OS/2 patches folded in
11 *
a687059c 12 * Revision 3.0 89/10/18 15:18:39 lwall
13 * 3.0 baseline
8d063cd8 14 *
15 */
16
a687059c 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)*/
8d063cd8 20
154e51a4 21#define COEFFSIZE (16 * 8) /* size of coeff array */
8d063cd8 22
23typedef struct hentry HENT;
24
25struct hentry {
26 HENT *hent_next;
27 char *hent_key;
28 STR *hent_val;
29 int hent_hash;
a687059c 30 int hent_klen;
8d063cd8 31};
32
33struct htbl {
34 HENT **tbl_array;
a687059c 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 */
8d063cd8 38 int tbl_riter; /* current root of iterator */
39 HENT *tbl_eiter; /* current entry of iterator */
a687059c 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 */
8d063cd8 49};
50
51STR *hfetch();
52bool hstore();
378cc40b 53STR *hdelete();
8d063cd8 54HASH *hnew();
378cc40b 55void hclear();
378cc40b 56void hentfree();
8d063cd8 57int hiterinit();
58HENT *hiternext();
59char *hiterkey();
60STR *hiterval();
a687059c 61bool hdbmopen();
62void hdbmclose();
63bool hdbmstore();