Add clear functions to table and trie.

This commit is contained in:
2018-05-31 19:29:14 -07:00
parent 34b97e42ac
commit 19416d0e15
4 changed files with 14 additions and 0 deletions

View File

@@ -134,6 +134,11 @@ libab_result libab_table_put(libab_table* table, const char* string,
* @param parent a valid reference to a parent table.
*/
void libab_table_set_parent(libab_table* table, libab_ref* parent);
/**
* Clears the table.
* @param table the table to clear.
*/
void libab_table_clear(libab_table* table);
/**
* Frees the resources allocated by the
* given table.

View File

@@ -60,6 +60,7 @@ libab_result libab_trie_put(libab_trie* trie, const char* key, void* value);
const ll* libab_trie_get(const libab_trie* trie, const char* key);
int libab_trie_foreach(const libab_trie* trie, void* data, compare_func compare,
foreach_func foreach);
void libab_trie_clear(libab_trie* trie);
void libab_trie_free(libab_trie* trie);
#endif