#include #include #include #include "eprintf.h" #include "strlist.h" void sl_append(struct strlist *sl, const char **list, int count) { assert(sl != NULL); sl->list = erealloc(sl->list, (sl->count + count) * sizeof *sl->list); memcpy(sl->list + sl->count, list, count * sizeof *list); sl->count += count; } void sl_free(struct strlist *sl) { assert(sl != NULL); free(sl->list); sl->list = NULL; sl->count = 0; }