6 #ifndef __HASH_H_ /* include guard */
9 /* implementation independent declarations */
12 HASH_STATUS_MEM_EXHAUSTED,
13 HASH_STATUS_KEY_NOT_FOUND
16 typedef struct node_tag {
17 struct node_tag *next; /* next node */
19 void* rec; /* user data */
23 int (*compare) (void*, void*);
25 void* (*copy_key) (void*);
26 void (*delete_key) (void*);
27 hash_node_type** table;
32 hash_status_enum hash_initialise(hash_type*);
33 hash_status_enum hash_destroy(hash_type*);
34 hash_status_enum hash_insert(hash_type*, void* key, void *rec);
35 hash_status_enum hash_delete(hash_type* hash_table, void* key);
36 hash_status_enum hash_find(hash_type* hash_table, void* key, void** rec);
37 hash_status_enum hash_next_item(hash_type* hash_table, hash_node_type** ppnode);
38 void hash_delete_all(hash_type* hash_table);
40 #endif /* __HASH_H_ */