Crossfire Server, Branches 1.12  R18729
hashtable.h
Go to the documentation of this file.
1 /* Usually we will store only about 10 or so elements, however we may get
2  * cases of a fair bit more and we should handle those cases efficently.
3  * hashptr() assumes this value will fit in int.
4  */
5 #define PTR_ASSOC_TABLESIZE 251
6 
7 typedef struct _ptr_assoc {
8  struct _ptr_assoc **array;
10  struct _ptr_assoc *next;
11  void *key;
12  void *value;
13 } ptr_assoc;
14 
16 
18 extern void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value);
19 extern void *find_assoc_value(ptr_assoc **hash_table, void *key);
20 extern void free_ptr_assoc(ptr_assoc **hash_table, void *key);
ptr_assoc * ptr_assoc_table[PTR_ASSOC_TABLESIZE]
Definition: hashtable.h:15
struct _ptr_assoc * next
Definition: hashtable.h:10
void free_ptr_assoc(ptr_assoc **hash_table, void *key)
Definition: hashtable.c:222
void * find_assoc_value(ptr_assoc **hash_table, void *key)
Definition: hashtable.c:205
void * key
Definition: hashtable.h:11
void * value
Definition: hashtable.h:12
static shared_string * hash_table[TABLESIZE]
Definition: shstr.c:42
void init_ptr_assoc_table(ptr_assoc **hash_table)
Definition: hashtable.c:57
struct _ptr_assoc * previous
Definition: hashtable.h:9
struct _ptr_assoc ** array
Definition: hashtable.h:8
struct _ptr_assoc ptr_assoc
#define PTR_ASSOC_TABLESIZE
Definition: hashtable.h:5
void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value)
Definition: hashtable.c:109