diff options
Diffstat (limited to 'table.c')
-rw-r--r-- | table.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -171,3 +171,11 @@ void * remove_table_index(struct table *tbl, struct string name) { return ptr; } + +void clear_table(struct table *tbl) { + for (uint64_t i = 0; i < tbl->len; i++) + free(tbl->array[i].name.data); + + tbl->array = realloc(tbl->array, 0); + tbl->len = 0; +} |