00001 typedef struct util_hash_node { 00002 struct util_hash_node* next; 00003 struct util_hash_node* prev; 00004 void* data; 00005 char key[64]; 00006 int ref_counter; 00007 00008 } Util_hash_node; 00009 00010 00011 typedef struct util_hash { 00012 unsigned int hashTable_size; 00013 Util_hash_node** hashTable; 00014 00015 } Util_hash; 00016 00017 00018 extern void util_hash_init(void); 00019 extern void util_hash_finish(void); 00020 extern inline Util_hash* util_hash_create( int hashTable_size ); 00021 extern inline void util_hash_destroy( Util_hash* hash ); 00022 extern char util_hash_set_data( Util_hash* hash, char* key, void* data ); 00023 extern char util_hash_remove_data( Util_hash* hash, char* key ); 00024 extern void* util_hash_ref_data( Util_hash* hash, char* key, int ref ); 00025 extern int util_hash_get_refCounter( Util_hash* hash, char* key ); 00026 extern char util_hash_ref( Util_hash* hash, char* key ); 00027 00028 00029 #define UTILHASH_INCREMENT_REFCNT 1 00030 #define UTILHASH_DECREMENT_REFCNT -1