summaryrefslogtreecommitdiff
path: root/table.c
diff options
context:
space:
mode:
Diffstat (limited to 'table.c')
-rw-r--r--table.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/table.c b/table.c
index a06e034..a4adf61 100644
--- a/table.c
+++ b/table.c
@@ -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;
+}