source: trunk/third/perl/x2p/hash.h @ 14545

Revision 14545, 1.4 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14544, which included commits to RCS files with non-trunk default branches.
Line 
1/* $RCSfile: hash.h,v $$Revision: 1.1.1.3 $$Date: 2000-04-07 20:47:59 $
2 *
3 *    Copyright (c) 1991-1997, Larry Wall
4 *
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.
7 *
8 * $Log: not supported by cvs2svn $
9 */
10
11#define FILLPCT 60              /* don't make greater than 99 */
12
13#ifdef DOINIT
14char coeff[] = {
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                61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1};
23#else
24extern char coeff[];
25#endif
26
27typedef struct hentry HENT;
28
29struct hentry {
30    HENT        *hent_next;
31    char        *hent_key;
32    STR         *hent_val;
33    int         hent_hash;
34};
35
36struct htbl {
37    HENT        **tbl_array;
38    int         tbl_max;
39    int         tbl_fill;
40    int         tbl_riter;      /* current root of iterator */
41    HENT        *tbl_eiter;     /* current entry of iterator */
42};
43
44bool hdelete (HASH *tb, char *key);
45STR * hfetch ( HASH *tb, char *key );
46int hiterinit ( HASH *tb );
47char * hiterkey ( HENT *entry );
48HENT * hiternext ( HASH *tb );
49STR * hiterval ( HENT *entry );
50HASH * hnew ( void );
51void hsplit ( HASH *tb );
52bool hstore ( HASH *tb, char *key, STR *val );
Note: See TracBrowser for help on using the repository browser.