Coda Distributed File System
ds_hash.private.h
Go to the documentation of this file.
1/*
2** ds_hash.private.h: Implementation details of ds_hash_t, ds_hash_elt_t
3*/
4
5#ifndef _DS_HASH_PRIVATE_H_
6#define _DS_HASH_PRIVATE_H_
7
8#include <odytypes.h>
9
10#include "ds_list.h" /* we're a client of lists */
11#include "ds_hash.h" /* public parts */
12
13/* magic numbers for structures */
14
15extern const magic_t ds_hash_magic;
16extern const magic_t ds_hash_iter_magic;
17
18/* A hash table has a magic number, an array of ds_list_t's,
19 and a count of the number of elements.
20 The safety and duplicate properties are maintained by the
21 table's lists; the table doesn't bother about it.
22
23 Hash tables are pretty simple: lists do most of the work
24 They also don't need to keep track of their iterators: the lists
25 do that (remember, that a hash iterator is just a list iterator
26 that is pointed at several lists in a row.)
27*/
28
29struct ds_hash_t {
34 int count;
35};
36
42};
43
44#define DS_HASH_VALID(tp) ((tp) && ((tp)->magic == ds_hash_magic))
45#define DS_HASH_ITER_VALID(ip) ((ip) && ((ip)->magic == ds_hash_iter_magic))
46
47#endif /* _DS_HASH_PRIVATE_H_ */
long(* HFN)()
Definition: ds_hash.h:29
const magic_t ds_hash_magic
Definition: ds_hash.c:18
const magic_t ds_hash_iter_magic
Definition: ds_hash.c:19
unsigned long magic_t
Definition: odytypes.h:44
Definition: ds_hash.private.h:37
int curbucket
Definition: ds_hash.private.h:40
ds_hash_t * table
Definition: ds_hash.private.h:39
magic_t magic
Definition: ds_hash.private.h:38
ds_list_iter_t * curiter
Definition: ds_hash.private.h:41
Definition: ds_hash.private.h:29
magic_t magic
Definition: ds_hash.private.h:30
int nbuckets
Definition: ds_hash.private.h:32
int count
Definition: ds_hash.private.h:34
HFN hfn
Definition: ds_hash.private.h:31
ds_list_t ** buckets
Definition: ds_hash.private.h:33
Definition: ds_list.private.h:52
Definition: ds_list.private.h:41