perl 5.0 alpha 6
[p5sagit/p5-mst-13.2.git] / x2p / hash.h
CommitLineData
79072805 1/* $RCSfile: hash.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:21 $
a687059c 2 *
352d5a3a 3 * Copyright (c) 1991, Larry Wall
a687059c 4 *
352d5a3a 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.
8d063cd8 7 *
8 * $Log: hash.h,v $
79072805 9 * Revision 4.1 92/08/07 18:29:21 lwall
10 *
352d5a3a 11 * Revision 4.0.1.1 91/06/07 12:16:04 lwall
12 * patch4: new copyright notice
13 *
fe14fcc3 14 * Revision 4.0 91/03/20 01:57:53 lwall
15 * 4.0 baseline.
8d063cd8 16 *
17 */
18
19#define FILLPCT 60 /* don't make greater than 99 */
20
21#ifdef DOINIT
22char coeff[] = {
23 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
24 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
25 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
26 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
27 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
28 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
29 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
30 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1};
31#else
32extern char coeff[];
33#endif
34
35typedef struct hentry HENT;
36
37struct hentry {
38 HENT *hent_next;
39 char *hent_key;
40 STR *hent_val;
41 int hent_hash;
42};
43
44struct htbl {
45 HENT **tbl_array;
46 int tbl_max;
47 int tbl_fill;
48 int tbl_riter; /* current root of iterator */
49 HENT *tbl_eiter; /* current entry of iterator */
50};
51
52STR *hfetch();
53bool hstore();
54bool hdelete();
55HASH *hnew();
56int hiterinit();
57HENT *hiternext();
58char *hiterkey();
59STR *hiterval();