Crossfire Server, Branch 1.12
R12190
|
00001 /* Usually we will store only about 10 or so elements, however we may get 00002 * cases of a fair bit more and we should handle those cases efficently. 00003 * hashptr() assumes this value will fit in int. 00004 */ 00005 #define PTR_ASSOC_TABLESIZE 251 00006 00007 typedef struct _ptr_assoc { 00008 struct _ptr_assoc **array; 00009 struct _ptr_assoc *previous; 00010 struct _ptr_assoc *next; 00011 void *key; 00012 void *value; 00013 } ptr_assoc; 00014 00015 typedef ptr_assoc *ptr_assoc_table[PTR_ASSOC_TABLESIZE]; 00016 00017 extern void init_ptr_assoc_table(ptr_assoc **hash_table); 00018 extern void add_ptr_assoc(ptr_assoc **hash_table, void *key, void *value); 00019 extern void *find_assoc_value(ptr_assoc **hash_table, void *key); 00020 extern void free_ptr_assoc(ptr_assoc **hash_table, void *key);