void hashtable_clear(HASHTABLE *t) { size_t i, j; j = array_size(&t->table); for (i = 0; i != j; ++i) { dlist_clear((DLIST*)array_at(&t->table, i)); } t->size = 0; }
void hash_clear(hash_table_t *table, ds_callback_t cb, void *param) { int i; if (table == NULL) return; for (i = 0; i < table->size; i++) dlist_clear(&table->table[i], cb, param); }
void dlist_destroy( lc_dlist_t* p_list ) { dlist_clear( p_list ); #ifdef _DLIST_DEBUG p_list->head = NULL; p_list->tail = NULL; p_list->size = 0; p_list->destroy = NULL; #endif }
void dlist_clear_destroy(t_dlist *dlist) { dlist_clear(dlist); dlist_destroy(dlist); }