Crossfire Server, Branches 1.12
R18729
|
Go to the source code of this file.
Data Structures | |
struct | _ptr_assoc |
Macros | |
#define | PTR_ASSOC_TABLESIZE 251 |
Typedefs | |
typedef struct _ptr_assoc | ptr_assoc |
typedef ptr_assoc * | ptr_assoc_table [PTR_ASSOC_TABLESIZE] |
Functions | |
void | add_ptr_assoc (ptr_assoc **hash_table, void *key, void *value) |
void * | find_assoc_value (ptr_assoc **hash_table, void *key) |
void | free_ptr_assoc (ptr_assoc **hash_table, void *key) |
void | init_ptr_assoc_table (ptr_assoc **hash_table) |
#define PTR_ASSOC_TABLESIZE 251 |
Definition at line 5 of file hashtable.h.
Referenced by hashptr(), and init_ptr_assoc_table().
typedef struct _ptr_assoc ptr_assoc |
typedef ptr_assoc* ptr_assoc_table[PTR_ASSOC_TABLESIZE] |
Definition at line 15 of file hashtable.h.
void add_ptr_assoc | ( | ptr_assoc ** | hash_table, |
void * | key, | ||
void * | value | ||
) |
Adds a value to a hash table which one can lookup with key.
hash_table | Pointer to the hash table to add to. |
key | The key to lookup by in the association. |
value | The value to store with the key. |
Definition at line 109 of file hashtable.c.
References _ptr_assoc::array, hashptr(), _ptr_assoc::key, new_ptr_assoc(), _ptr_assoc::next, _ptr_assoc::previous, and _ptr_assoc::value.
Referenced by add_map_assoc(), and add_object_assoc().
void* find_assoc_value | ( | ptr_assoc ** | hash_table, |
void * | key | ||
) |
Find the value associated with a given key.
hash_table | Pointer to the hash table to search. |
key | The key to lookup by in the association. |
Definition at line 205 of file hashtable.c.
References find_ptr_assoc(), and _ptr_assoc::value.
Referenced by find_assoc_pymap(), and find_assoc_pyobject().
void free_ptr_assoc | ( | ptr_assoc ** | hash_table, |
void * | key | ||
) |
Remove the association with a given key.
hash_table | Pointer to the hash table to search. |
key | The key to lookup by in the association. |
Definition at line 222 of file hashtable.c.
References _ptr_assoc::array, find_ptr_assoc(), _ptr_assoc::next, and _ptr_assoc::previous.
Referenced by free_map_assoc(), and free_object_assoc().
void init_ptr_assoc_table | ( | ptr_assoc ** | hash_table | ) |
Initialises the hash table for a pointer association table.
hash_table | Pointer to the hash table to initialise. |
Definition at line 57 of file hashtable.c.
References hash_table, and PTR_ASSOC_TABLESIZE.
Referenced by init_map_assoc_table(), and init_object_assoc_table().