Crossfire Server, Trunk
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);
init_ptr_assoc_table
void init_ptr_assoc_table(ptr_assoc **hash_table)
Definition: hashtable.cpp:56
_ptr_assoc::key
void * key
Definition: hashtable.h:11
_ptr_assoc
Definition: hashtable.h:7
_ptr_assoc::array
struct _ptr_assoc ** array
Definition: hashtable.h:8
free_ptr_assoc
void free_ptr_assoc(ptr_assoc **hash_table, void *key)
Definition: hashtable.cpp:221
find_assoc_value
void * find_assoc_value(ptr_assoc **hash_table, void *key)
Definition: hashtable.cpp:204
add_ptr_assoc
void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value)
Definition: hashtable.cpp:108
hash_table
static shared_string * hash_table[TABLESIZE]
Definition: shstr.cpp:50
PTR_ASSOC_TABLESIZE
#define PTR_ASSOC_TABLESIZE
Definition: hashtable.h:5
ptr_assoc_table
ptr_assoc * ptr_assoc_table[PTR_ASSOC_TABLESIZE]
Definition: hashtable.h:15
_ptr_assoc::next
struct _ptr_assoc * next
Definition: hashtable.h:10
autojail.value
value
Definition: autojail.py:6
ptr_assoc
struct _ptr_assoc ptr_assoc
castle_read.key
key
Definition: castle_read.py:64
_ptr_assoc::previous
struct _ptr_assoc * previous
Definition: hashtable.h:9
_ptr_assoc::value
void * value
Definition: hashtable.h:12