source: trunk/essentials/dev-lang/perl/x2p/hash.h

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 1.2 KB
Line 
1/* hash.h
2 *
3 * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2005
4 * by Larry Wall and others
5 *
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8 */
9
10#define FILLPCT 60 /* don't make greater than 99 */
11
12#ifdef DOINIT
13char const coeff[] = {
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 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1};
22#else
23extern const char coeff[];
24#endif
25
26typedef struct hentry HENT;
27
28struct hentry {
29 HENT *hent_next;
30 char *hent_key;
31 STR *hent_val;
32 int hent_hash;
33};
34
35struct htbl {
36 HENT **tbl_array;
37 int tbl_max;
38 int tbl_fill;
39 int tbl_riter; /* current root of iterator */
40 HENT *tbl_eiter; /* current entry of iterator */
41};
42
43STR * hfetch ( HASH *tb, char *key );
44int hiterinit ( HASH *tb );
45HASH * hnew ( void );
46void hsplit ( HASH *tb );
47bool hstore ( HASH *tb, char *key, STR *val );
Note: See TracBrowser for help on using the repository browser.