diff options
Diffstat (limited to 'common/list.c')
-rw-r--r-- | common/list.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c index 39cc10e1..cab10c1e 100644 --- a/common/list.c +++ b/common/list.c @@ -62,6 +62,13 @@ void list_cat(list_t *list, list_t *source) { } } +void list_empty(list_t *list) { + list->capacity = 10; + list->length = 0; + free(list->items); + list->items = malloc(sizeof(void*) * list->capacity); +} + void list_qsort(list_t *list, int compare(const void *left, const void *right)) { qsort(list->items, list->length, sizeof(void *), compare); } |