]> git.ipfire.org Git - thirdparty/squid.git/blob - test-suite/hash.h
Merged from trunk
[thirdparty/squid.git] / test-suite / hash.h
1 #define DEFAULT_HASH_SIZE 7951
2 extern "C"
3 {
4 typedef unsigned int HASHHASH(const void *, unsigned int);
5 struct _hash_link {
6 char *key;
7 struct _hash_link *next;
8 void *item;
9 };
10 typedef int HASHCMP(const void *, const void *);
11
12 typedef struct _hash_link hash_link;
13
14 struct _hash_table {
15 int valid;
16 hash_link **buckets;
17 HASHCMP *cmp;
18 HASHHASH *hash;
19 unsigned int size;
20 unsigned int current_slot;
21 hash_link *current_ptr;
22 };
23 typedef struct _hash_table hash_table;
24
25 extern int hash_links_allocated;
26 /* AYJ: defined by globals.h */
27 //extern int store_hash_buckets; /* 0 */
28 //extern hash_table *store_table; /* NULL */
29 extern hash_table *hash_create(HASHCMP *, int, HASHHASH *);
30 extern void hash_insert(hash_table *, const char *, void *);
31 extern int hash_delete(hash_table *, const char *);
32 int hash_delete_link(hash_table *, hash_link *);
33 int hash_unlink(hash_table *, hash_link *, int);
34 void hash_join(hash_table *, hash_link *);
35 int hash_remove_link(hash_table *, hash_link *);
36 hash_link *hash_lookup(hash_table *, const void *);
37 hash_link *hash_first(hash_table *);
38 hash_link *hash_next(hash_table *);
39 hash_link *hash_get_bucket(hash_table *, unsigned int);
40 void hashFreeMemory(hash_table *);
41 HASHHASH hash_string;
42 HASHHASH hash_url;
43 HASHHASH hash4;
44
45 }