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