-/* ptr pointer to the hash table to be freed
- * destroy() function to call to free the ->data member (optional)
- */
-void hash_destroy(HASH **ptr, void (*destroy)(void *))
-{
- int i;
- HASH *pptr = *ptr;
- struct hash_elem *elem, *tmp;
-
- for (i = 0; i < pptr->nelem; i++) {
- for (elem = pptr->table[i]; elem;) {
- tmp = elem;
- elem = elem->next;
- if (destroy)
- destroy (tmp->data);
- p_delete(&tmp);
- }
- }
- p_delete(&pptr->table);
- p_delete(ptr);
-}
-
-void hash_map(HASH *table,