]> git.ipfire.org Git - thirdparty/dhcp.git/blob - includes/hash.h
c4b063559c2bedeb69c785ac903feb3050b2abf0
[thirdparty/dhcp.git] / includes / hash.h
1 /* hash.h
2
3 Definitions for hashing... */
4
5 /*
6 * Copyright (c) 1996-1999 Internet Software Consortium.
7 * Use is subject to license terms which appear in the file named
8 * ISC-LICENSE that should have accompanied this file when you
9 * received it. If a file named ISC-LICENSE did not accompany this
10 * file, or you are not sure the one you have is correct, you may
11 * obtain an applicable copy of the license at:
12 *
13 * http://www.isc.org/isc-license-1.0.html.
14 *
15 * This file is part of the ISC DHCP distribution. The documentation
16 * associated with this file is listed in the file DOCUMENTATION,
17 * included in the top-level directory of this release.
18 *
19 * Support and other services are available for ISC products - see
20 * http://www.isc.org for more information.
21 */
22
23 #define DEFAULT_HASH_SIZE 97
24
25 typedef int (*hash_reference) (void *, void *, const char *, int);
26 typedef int (*hash_dereference) (void *, const char *, int);
27
28 struct hash_bucket {
29 struct hash_bucket *next;
30 const unsigned char *name;
31 unsigned len;
32 void *value;
33 };
34
35 struct hash_table {
36 unsigned hash_count;
37 struct hash_bucket *buckets [DEFAULT_HASH_SIZE];
38 hash_reference referencer;
39 hash_dereference dereferencer;
40 };
41
42 struct named_hash {
43 struct named_hash *next;
44 const char *name;
45 struct hash_table *hash;
46 };