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