]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - hashlib.h
Imported from ../bash-2.04.tar.gz.
[thirdparty/bash.git] / hashlib.h
index 95a9164b7811492378c257253ba8c33f4dfece5f..d8cc793eba7ddf00700702a02a51b4bb0f0e4490 100644 (file)
--- a/hashlib.h
+++ b/hashlib.h
 
    You should have received a copy of the GNU General Public License along
    with Bash; see the file COPYING.  If not, write to the Free Software
-   Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+   Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
 
 #if !defined (_HASHLIB_H_)
 #define _HASHLIB_H_
 
+#include "stdc.h"
+
 typedef struct bucket_contents {
   struct bucket_contents *next;        /* Link to next hashed key in this bucket. */
   char *key;                   /* What we look up. */
@@ -34,13 +36,13 @@ typedef struct hash_table {
   int nentries;                        /* How many entries does this table have. */
 } HASH_TABLE;
 
-extern int hash_string ();
-extern HASH_TABLE *make_hash_table ();
-extern BUCKET_CONTENTS *find_hash_item ();
-extern BUCKET_CONTENTS *remove_hash_item ();
-extern BUCKET_CONTENTS *add_hash_item ();
-extern BUCKET_CONTENTS *get_hash_bucket ();
-extern void flush_hash_table ();
+extern int hash_string __P((char *, HASH_TABLE *));
+extern HASH_TABLE *make_hash_table __P((int));
+extern BUCKET_CONTENTS *find_hash_item __P((char *, HASH_TABLE *));
+extern BUCKET_CONTENTS *remove_hash_item __P((char *, HASH_TABLE *));
+extern BUCKET_CONTENTS *add_hash_item __P((char *, HASH_TABLE *));
+extern void flush_hash_table __P((HASH_TABLE *, VFunction *));
+extern void dispose_hash_table __P((HASH_TABLE *));
 
 /* Redefine the function as a macro for speed. */
 #define get_hash_bucket(bucket, table) \
@@ -49,7 +51,9 @@ extern void flush_hash_table ();
                (BUCKET_CONTENTS *)NULL)
 
 /* Default number of buckets in the hash table. */
-#define DEFAULT_HASH_BUCKETS 107
+#define DEFAULT_HASH_BUCKETS 53        /* was 107 */
+
+#define HASH_ENTRIES(ht)       (ht)->nentries
 
 #if !defined (NULL)
 #  if defined (__STDC__)