Initial "gts1" commit.
[tac_plus.git] / hash.c
diff --git a/hash.c b/hash.c
index 443d42b..2db807b 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Copyright (c) 1995-1998 by Cisco systems, Inc.
 
    Permission to use, copy, modify, and distribute this software for
    FITNESS FOR A PARTICULAR PURPOSE.
 */
 
+
 #include "tac_plus.h"
 
+#include "hash.h"
+#include "utils.h"
+
+
 struct entry {
     char *name;
     void *hash;
 };
 
-typedef struct entry ENTRY;
+static int calculate_hash TAC_ARGS((const char *name));
 
 /* Calculate hash value from a string */
 static int
 calculate_hash(name)
-char *name;
+const char *name;
 {
     int i;
     int len = strlen(name);
@@ -43,12 +48,14 @@ char *name;
     return (hashval);
 }
 
+void *hash_lookup TAC_ARGS((void **hashtab, const char *name));
+
 /* Lookup a name in a hash table.  Return its node if it exists, NULL
    otherwise */
 void *
 hash_lookup(hashtab, name)
 void **hashtab;
-char *name;
+const char *name;
 {
     ENTRY *entry;
     int hashval = calculate_hash(name);
@@ -64,6 +71,8 @@ char *name;
     return (NULL);
 }
 
+void *hash_add_entry TAC_ARGS((void **hashtab, ENTRY *newentry));
+
 /* Add a node to a hash table.  Return node if it exists, NULL
    otherwise */
 void *
@@ -86,6 +95,8 @@ ENTRY *newentry;
 }
 
 
+void **hash_get_entries TAC_ARGS((void **hashtab));
+
 /* Return an array of pointers to all the entries in a hash table */
 void **
 hash_get_entries(hashtab)