| 162 | } |
| 163 | |
| 164 | void string_list_clear(struct string_list *list, int free_util) |
| 165 | { |
| 166 | if (list->items) { |
| 167 | if (list->strdup_strings) { |
| 168 | for (size_t i = 0; i < list->nr; i++) |
| 169 | free(list->items[i].string); |
| 170 | } |
| 171 | if (free_util) { |
| 172 | for (size_t i = 0; i < list->nr; i++) |
| 173 | free(list->items[i].util); |
| 174 | } |
| 175 | free(list->items); |
| 176 | } |
| 177 | list->items = NULL; |
| 178 | list->nr = list->alloc = 0; |
| 179 | } |
| 180 | |
| 181 | void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc) |
| 182 | { |
no outgoing calls