netatalk  4.4.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
include/atalk/hash.h
Go to the documentation of this file.
1/*
2 * Hash Table Data Type
3 * Copyright (C) 1997 Kaz Kylheku <[email protected]>
4 *
5 * Free Software License:
6 *
7 * All rights are reserved by the author, with the following exceptions:
8 * Permission is granted to freely reproduce and distribute this software,
9 * possibly in exchange for a fee, provided that this copyright notice appears
10 * intact. Permission is also granted to adapt this software to produce
11 * derivative works, as long as the modified versions carry this copyright
12 * notice and additional notices stating that the work has been modified.
13 * This source code may be translated into executable form and incorporated
14 * into proprietary software; there is no requirement for such software to
15 * contain a copyright notice related to this source.
16 *
17 * $Name: $
18 */
19
20#ifndef ATALK_HASH_H
21#define ATALK_HASH_H
22
23#include <limits.h>
24#include <stdint.h>
25
26typedef unsigned long hashcount_t;
27#define HASHCOUNT_T_MAX ULONG_MAX
28
29typedef uint32_t hash_val_t;
30#define HASH_VAL_T_MAX UINT32_MAX
31
32extern int hash_val_t_bit;
33
34#ifndef HASH_VAL_T_BIT
35#define HASH_VAL_T_BIT ((int) hash_val_t_bit)
36#endif
37
62
63typedef struct hnode_t {
64#if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) /* 1 */
65 struct hnode_t *hash_next; /* 2 */
66 const void *hash_key; /* 3 */
67 void *hash_data; /* 4 */
69#else
70 int hash_dummy;
71#endif
73
80
81typedef int (*hash_comp_t)(const void *, const void *);
82
94
95typedef hash_val_t (*hash_fun_t)(const void *);
96
97/*
98 * allocator functions
99 */
100
101typedef hnode_t *(*hnode_alloc_t)(void *);
102typedef void (*hnode_free_t)(hnode_t *, void *);
103
138
158
168
169typedef struct hscan_t {
170#if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
174#else
175 int hash_dummy;
176#endif
178
179
180#endif /* ATALK_HASH_H */
int hash_val_t_bit
Definition hash.c:62
hash_val_t(* hash_fun_t)(const void *)
Definition include/atalk/hash.h:95
int(* hash_comp_t)(const void *, const void *)
Definition include/atalk/hash.h:81
void(* hnode_free_t)(hnode_t *, void *)
Definition include/atalk/hash.h:102
hnode_t *(* hnode_alloc_t)(void *)
Definition include/atalk/hash.h:101
uint32_t hash_val_t
Definition include/atalk/hash.h:29
unsigned long hashcount_t
Definition include/atalk/hash.h:26
Definition include/atalk/hash.h:139
hashcount_t hash_nodecount
Definition include/atalk/hash.h:143
hash_val_t hash_mask
Definition include/atalk/hash.h:152
hashcount_t hash_maxcount
Definition include/atalk/hash.h:144
hnode_alloc_t hash_allocnode
Definition include/atalk/hash.h:149
void * hash_context
Definition include/atalk/hash.h:151
hashcount_t hash_highmark
Definition include/atalk/hash.h:145
int hash_dynamic
Definition include/atalk/hash.h:153
hashcount_t hash_nchains
Definition include/atalk/hash.h:142
struct hnode_t ** hash_table
Definition include/atalk/hash.h:141
hashcount_t hash_lowmark
Definition include/atalk/hash.h:146
hash_fun_t hash_function
Definition include/atalk/hash.h:148
hash_comp_t hash_compare
Definition include/atalk/hash.h:147
hnode_free_t hash_freenode
Definition include/atalk/hash.h:150
Hash chain node structure.
Definition include/atalk/hash.h:63
struct hnode_t * hash_next
Definition include/atalk/hash.h:65
hash_val_t hash_hkey
Definition include/atalk/hash.h:68
const void * hash_key
Definition include/atalk/hash.h:66
void * hash_data
Definition include/atalk/hash.h:67
Definition include/atalk/hash.h:169
hash_t * hash_table
Definition include/atalk/hash.h:171
hnode_t * hash_next
Definition include/atalk/hash.h:173
hash_val_t hash_chain
Definition include/atalk/hash.h:172