-/*
+/*
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);
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);
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 *
}
+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)