diff options
author | Test_User <hax@andrewyu.org> | 2023-09-02 21:17:20 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2023-09-02 21:17:20 -0400 |
commit | 9a1fdcc9d24fe8dd20cacee0e25a57c6219651a2 (patch) | |
tree | 3958a711dcb053d034bd4284ce63c91e884799f0 /table.c | |
parent | e5a21f16ce6544f5291af4e5413388b9a576d68f (diff) | |
download | c_coupserv-9a1fdcc9d24fe8dd20cacee0e25a57c6219651a2.tar.gz c_coupserv-9a1fdcc9d24fe8dd20cacee0e25a57c6219651a2.zip |
clear command, some other old stufff I forgot to commit
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; +} |