32#if !defined (DEFAULT_HASH_SIZE)
33# define DEFAULT_HASH_SIZE 9973
36#if !defined (KEY_HASH_SIZE)
37# define KEY_HASH_SIZE 1009
64 unsigned (*
do_hash)(
const void *, unsigned, unsigned);
76#define HASH_FUNCTIONS_DECL(name, bufarg, type, hashtype) \
77void name##_hash_add (hashtype *, bufarg, unsigned, type *, \
79void name##_hash_delete (hashtype *, bufarg, unsigned, \
81int name##_hash_lookup (type **, hashtype *, bufarg, unsigned, \
83unsigned char * name##_hash_report(hashtype *); \
84int name##_hash_foreach (hashtype *, hash_foreach_func); \
85int name##_new_hash (hashtype **, unsigned, const char *, int); \
86void name##_free_hash_table (hashtype **, const char *, int);
89#define HASH_FUNCTIONS(name, bufarg, type, hashtype, ref, deref, hasher) \
90void name##_hash_add (hashtype *table, \
91 bufarg buf, unsigned len, type *ptr, \
92 const char *file, int line) \
94 add_hash ((struct hash_table *)table, buf, \
95 len, (hashed_object_t *)ptr, file, line); \
98void name##_hash_delete (hashtype *table, bufarg buf, unsigned len, \
99 const char *file, int line) \
101 delete_hash_entry ((struct hash_table *)table, buf, len, \
105int name##_hash_lookup (type **ptr, hashtype *table, \
106 bufarg buf, unsigned len, const char *file, int line) \
108 return hash_lookup ((hashed_object_t **)ptr, \
109 (struct hash_table *)table, \
110 buf, len, file, line); \
113unsigned char * name##_hash_report(hashtype *table) \
115 return hash_report((struct hash_table *)table); \
118int name##_hash_foreach (hashtype *table, hash_foreach_func func) \
120 return hash_foreach ((struct hash_table *)table, \
124int name##_new_hash (hashtype **tp, unsigned c, const char *file, int line) \
126 return new_hash ((struct hash_table **)tp, \
127 (hash_reference)ref, (hash_dereference)deref, c, \
128 hasher, file, line); \
131void name##_free_hash_table (hashtype **table, const char *file, int line) \
133 free_hash_table ((struct hash_table **)table, file, line); \
143 unsigned (*do_hash)(
const void *,
unsigned,
unsigned),
147unsigned do_id_hash(
const void *,
unsigned,
unsigned);
149unsigned do_ip4_hash(
const void *,
unsigned,
unsigned);
155 unsigned,
const char *,
int);
157 const void *,
unsigned,
const char *,
int);
159int casecmp (
const void *s,
const void *t,
size_t len);
struct hash_bucket * new_hash_bucket(const char *, int)
int casecmp(const void *s, const void *t, size_t len)
int hash_foreach(struct hash_table *, hash_foreach_func)
void free_hash_bucket(struct hash_bucket *, const char *, int)
unsigned do_case_hash(const void *, unsigned, unsigned)
void relinquish_hash_bucket_hunks(void)
unsigned do_id_hash(const void *, unsigned, unsigned)
void delete_hash_entry(struct hash_table *, const void *, unsigned, const char *, int)
int(* hash_dereference)(hashed_object_t **, const char *, int)
int(* hash_comparator_t)(const void *, const void *, size_t)
int hash_lookup(hashed_object_t **, struct hash_table *, const void *, unsigned, const char *, int)
isc_result_t(* hash_foreach_func)(const void *, unsigned, void *)
int new_hash(struct hash_table **, hash_reference, hash_dereference, unsigned, unsigned(*do_hash)(const void *, unsigned, unsigned), const char *, int)
int new_hash_table(struct hash_table **, unsigned, const char *, int)
int(* hash_reference)(hashed_object_t **, hashed_object_t *, const char *, int)
unsigned do_string_hash(const void *, unsigned, unsigned)
unsigned do_ip4_hash(const void *, unsigned, unsigned)
unsigned do_number_hash(const void *, unsigned, unsigned)
void add_hash(struct hash_table *, const void *, unsigned, hashed_object_t *, const char *, int)
void free_hash_table(struct hash_table **, const char *, int)
unsigned char * hash_report(struct hash_table *)
struct hash_bucket * next
const unsigned char * name
hash_dereference dereferencer
unsigned(* do_hash)(const void *, unsigned, unsigned)
hash_reference referencer
struct hash_bucket * buckets[1]