This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 4.0 patch 6: patch #4, continued
[perl5.git] / x2p / hash.h
CommitLineData
fe14fcc3 1/* $Header: hash.h,v 4.0 91/03/20 01:57:53 lwall Locked $
a687059c
LW
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
LW
7 *
8 * $Log: hash.h,v $
fe14fcc3
LW
9 * Revision 4.0 91/03/20 01:57:53 lwall
10 * 4.0 baseline.
8d063cd8
LW
11 *
12 */
13
14#define FILLPCT 60 /* don't make greater than 99 */
15
16#ifdef DOINIT
17char coeff[] = {
18 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
19 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
20 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
21 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
22 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
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#else
27extern char coeff[];
28#endif
29
30typedef struct hentry HENT;
31
32struct hentry {
33 HENT *hent_next;
34 char *hent_key;
35 STR *hent_val;
36 int hent_hash;
37};
38
39struct htbl {
40 HENT **tbl_array;
41 int tbl_max;
42 int tbl_fill;
43 int tbl_riter; /* current root of iterator */
44 HENT *tbl_eiter; /* current entry of iterator */
45};
46
47STR *hfetch();
48bool hstore();
49bool hdelete();
50HASH *hnew();
51int hiterinit();
52HENT *hiternext();
53char *hiterkey();
54STR *hiterval();