X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=include%2Finn%2Fhashtab.h;fp=include%2Finn%2Fhashtab.h;h=0000000000000000000000000000000000000000;hb=b7a32e2d73e3ab1add8208d3e157f7269a31ef4d;hp=8d9f31ec670923776e9397a1a374bc86747bacfa;hpb=ac902a8299ff4469b356836f431ead31c3377377;p=innduct.git diff --git a/include/inn/hashtab.h b/include/inn/hashtab.h deleted file mode 100644 index 8d9f31e..0000000 --- a/include/inn/hashtab.h +++ /dev/null @@ -1,60 +0,0 @@ -/* $Id: hashtab.h 5944 2002-12-08 02:33:08Z rra $ -** -** Generic hash table interface. -** -** Written by Russ Allbery -** This work is hereby placed in the public domain by its author. -** -** A hash table takes a hash function that acts on keys, a function to -** extract the key from a data item stored in a hash, a function that takes -** a key and a data item and returns true if the key matches, and a -** function to be called on any data item being deleted from the hash. -** -** hash_create creates a hash and hash_free frees all the space allocated -** by one. hash_insert, hash_replace, and hash_delete modify it, and -** hash_lookup extracts values. hash_traverse can be used to walk the -** hash, and hash_count returns the number of elements currently stored in -** the hash. hash_searches, hash_collisions, and hash_expansions extract -** performance and debugging statistics. -*/ - -#ifndef INN_HASHTAB_H -#define INN_HASHTAB_H 1 - -#include - -BEGIN_DECLS - -/* The layout of this struct is entirely internal to the implementation. */ -struct hash; - -/* Data types for function pointers used by the hash table interface. */ -typedef unsigned long (*hash_func)(const void *); -typedef const void * (*hash_key_func)(const void *); -typedef bool (*hash_equal_func)(const void *, const void *); -typedef void (*hash_delete_func)(void *); -typedef void (*hash_traverse_func)(void *, void *); - -/* Generic hash table interface. */ -struct hash * hash_create(size_t, hash_func, hash_key_func, - hash_equal_func, hash_delete_func); -void hash_free(struct hash *); -void * hash_lookup(struct hash *, const void *key); -bool hash_insert(struct hash *, const void *key, void *datum); -bool hash_replace(struct hash *, const void *key, void *datum); -bool hash_delete(struct hash *, const void *key); -void hash_traverse(struct hash *, hash_traverse_func, void *); -unsigned long hash_count(struct hash *); -unsigned long hash_searches(struct hash *); -unsigned long hash_collisions(struct hash *); -unsigned long hash_expansions(struct hash *); - -/* Hash functions available for callers. */ -unsigned long hash_string(const void *); - -/* Functions useful for constructing new hashes. */ -unsigned long hash_lookup2(const char *, size_t, unsigned long partial); - -END_DECLS - -#endif /* INN_HASHTAB_H */