summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-03-28 08:41:02 +0000
committerjkh <jkh@FreeBSD.org>1995-03-28 08:41:02 +0000
commitafdcd6ad46299a13c0534681390fac3bc024950a (patch)
tree700be4c6c20764894c8e23932d45b7753617798f /lib
parent3fc004e9298a65d5adcdd6da5d34b0858eab0300 (diff)
downloadFreeBSD-src-afdcd6ad46299a13c0534681390fac3bc024950a.zip
FreeBSD-src-afdcd6ad46299a13c0534681390fac3bc024950a.tar.gz
Fix a missing _hash() to prevent namespace pollution with the db/hash routines.
Grrr. If the dbhash routines weren't grossly overengineered I wouldn't even need to do this! :-( Also now export the hash_stats routine. Manpage coming RSN - I promise.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/strhash.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/stdlib/strhash.c b/lib/libc/stdlib/strhash.c
index 77d8ac9..77bc02e 100644
--- a/lib/libc/stdlib/strhash.c
+++ b/lib/libc/stdlib/strhash.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.1 1995/03/26 10:21:55 jkh Exp $";
+static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.2 1995/03/26 19:32:24 ache Exp $";
#endif
/*
@@ -37,6 +37,9 @@ static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.1 19
/*
* $Log: strhash.c,v $
+ * Revision 1.2 1995/03/26 19:32:24 ache
+ * Hash 8bit chars without sign extension
+ *
* Revision 1.1 1995/03/26 10:21:55 jkh
* Add the strhash family of routines. They provide a number of features
* that the db/hash functions don't, and they're much simpler to use for
@@ -83,6 +86,7 @@ static char *rcsid = "$Header: /home/ncvs/src/lib/libc/stdlib/strhash.c,v 1.1 19
*/
+#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <strhash.h>
@@ -238,7 +242,7 @@ void *
hash_search(hash_table *table, caddr_t key, void *datum,
void (*replace_func)())
{
- int bucket = hash(table->size, key);
+ int bucket = _hash(table->size, key);
hash_node *found = list_find(key, table->buckets[bucket]);
if (found){
@@ -346,8 +350,7 @@ hash_purge(hash_table *table, void (*purge_func)(char *p1, void *p2))
}
}
-#ifdef HASH_STATS
-#include <stdio.h>
+#undef min
#define min(a, b) (a) < (b) ? (a) : (b)
/*
@@ -416,4 +419,3 @@ hash_stats(hash_table *table, int verbose)
}
return;
}
-#endif /* HASH_STATS */
OpenPOWER on IntegriCloud