1N/A/* $RCSfile: hash.h,v $$Revision: 4.1 $$Date: 92/08/07 18:29:21 $
1N/A *
1N/A * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1999, 2000,
1N/A * by Larry Wall and others
1N/A *
1N/A * You may distribute under the terms of either the GNU General Public
1N/A * License or the Artistic License, as specified in the README file.
1N/A *
1N/A * $Log: hash.h,v $
1N/A */
1N/A
1N/A#define FILLPCT 60 /* don't make greater than 99 */
1N/A
1N/A#ifdef DOINIT
1N/Achar coeff[] = {
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1,
1N/A 61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1};
1N/A#else
1N/Aextern char coeff[];
1N/A#endif
1N/A
1N/Atypedef struct hentry HENT;
1N/A
1N/Astruct hentry {
1N/A HENT *hent_next;
1N/A char *hent_key;
1N/A STR *hent_val;
1N/A int hent_hash;
1N/A};
1N/A
1N/Astruct htbl {
1N/A HENT **tbl_array;
1N/A int tbl_max;
1N/A int tbl_fill;
1N/A int tbl_riter; /* current root of iterator */
1N/A HENT *tbl_eiter; /* current entry of iterator */
1N/A};
1N/A
1N/Abool hdelete (HASH *tb, char *key);
1N/ASTR * hfetch ( HASH *tb, char *key );
1N/Aint hiterinit ( HASH *tb );
1N/Achar * hiterkey ( HENT *entry );
1N/AHENT * hiternext ( HASH *tb );
1N/ASTR * hiterval ( HENT *entry );
1N/AHASH * hnew ( void );
1N/Avoid hsplit ( HASH *tb );
1N/Abool hstore ( HASH *tb, char *key, STR *val );