diff options
Diffstat (limited to 'core/table.h')
-rw-r--r-- | core/table.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/table.h b/core/table.h index 1abfa6be3..da0bc96a5 100644 --- a/core/table.h +++ b/core/table.h @@ -91,4 +91,12 @@ return idx; \ } +#define MAKE_CLEAR_TABLE(table_type, array_name, item_name) \ + void clear_##table_type(struct table_type *table) \ + { \ + for (int i = 0; i < table->nr; i++) \ + free_##item_name(table->array_name[i]); \ + table->nr = 0; \ + } + #endif |