netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
etc/afpd/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 HASH_H
21#define HASH_H
22
23#include <limits.h>
24
25#include <atalk/hash.h>
26
29extern void hash_destroy(hash_t *);
30extern void hash_free_nodes(hash_t *);
31extern void hash_free(hash_t *);
34extern void hash_insert(hash_t *, hnode_t *, const void *);
35extern hnode_t *hash_lookup(hash_t *, const void *);
36extern hnode_t *hash_delete(hash_t *, hnode_t *);
37extern int hash_alloc_insert(hash_t *, const void *, void *);
38extern void hash_delete_free(hash_t *, hnode_t *);
39
40extern void hnode_put(hnode_t *, void *);
41extern void *hnode_get(hnode_t *);
42extern const void *hnode_getkey(hnode_t *);
45
46extern int hash_isfull(hash_t *);
47extern int hash_isempty(hash_t *);
48
49extern void hash_scan_begin(hscan_t *, hash_t *);
52extern void hash_scan_delfree(hash_t *, hnode_t *);
53
54extern int hash_verify(hash_t *);
55
56extern hnode_t *hnode_create(void *);
57extern hnode_t *hnode_init(hnode_t *, void *);
58extern void hnode_destroy(hnode_t *);
59
60#if defined(HASH_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG)
61#ifdef KAZLIB_SIDEEFFECT_DEBUG
62#define hash_isfull(H) (SFX_CHECK(H)->hash_nodecount == (H)->hash_maxcount)
63#else
64#define hash_isfull(H) ((H)->hash_nodecount == (H)->hash_maxcount)
65#endif
66#define hash_isempty(H) ((H)->hash_nodecount == 0)
67#define hash_count(H) ((H)->hash_nodecount)
68#define hash_size(H) ((H)->hash_nchains)
69#define hnode_get(N) ((N)->hash_data)
70#define hnode_getkey(N) ((N)->hash_key)
71#define hnode_put(N, V) ((N)->hash_data = (V))
72#endif
73
74#endif
void hash_insert(hash_t *, hnode_t *, const void *)
Definition hash.c:510
void hash_set_allocator(hash_t *, hnode_alloc_t, hnode_free_t, void *)
Definition hash.c:355
#define hnode_getkey(N)
Definition etc/afpd/hash.h:70
void hash_scan_delfree(hash_t *, hnode_t *)
Definition hash.c:680
void hash_delete_free(hash_t *, hnode_t *)
Definition hash.c:640
int hash_verify(hash_t *)
Definition hash.c:695
#define hnode_get(N)
Definition etc/afpd/hash.h:69
int hash_alloc_insert(hash_t *, const void *, void *)
Definition hash.c:627
hash_t * hash_init(hash_t *, hashcount_t, hash_comp_t, hash_fun_t, hnode_t **, hashcount_t)
void hash_free_nodes(hash_t *)
Definition hash.c:370
#define hnode_put(N, V)
Definition etc/afpd/hash.h:71
hnode_t * hash_scan_delete(hash_t *, hnode_t *)
Definition hash.c:651
hash_t * hash_create(hashcount_t, hash_comp_t, hash_fun_t)
Definition hash.c:305
hnode_t * hash_lookup(hash_t *, const void *)
Definition hash.c:551
hnode_t * hnode_create(void *)
hnode_t * hnode_init(hnode_t *, void *)
Definition hash.c:747
void hnode_destroy(hnode_t *)
hnode_t * hash_delete(hash_t *, hnode_t *)
Definition hash.c:588
#define hash_isfull(H)
Definition etc/afpd/hash.h:64
#define hash_isempty(H)
Definition etc/afpd/hash.h:66
void hash_destroy(hash_t *)
Definition hash.c:389
hnode_t * hash_scan_next(hscan_t *)
Definition hash.c:454
void hash_scan_begin(hscan_t *, hash_t *)
Definition hash.c:408
#define hash_size(H)
Definition etc/afpd/hash.h:68
#define hash_count(H)
Definition etc/afpd/hash.h:67
void hash_free(hash_t *)
hash_val_t(* hash_fun_t)(const void *)
Definition include/atalk/hash.h:94
int(* hash_comp_t)(const void *, const void *)
Definition include/atalk/hash.h:80
void(* hnode_free_t)(hnode_t *, void *)
Definition include/atalk/hash.h:101
hnode_t *(* hnode_alloc_t)(void *)
Definition include/atalk/hash.h:100
unsigned long hashcount_t
Definition include/atalk/hash.h:26
Definition include/atalk/hash.h:138
Definition include/atalk/hash.h:62
Definition include/atalk/hash.h:168