| 179 | } |
| 180 | |
| 181 | void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc) |
| 182 | { |
| 183 | if (list->items) { |
| 184 | if (clearfunc) { |
| 185 | for (size_t i = 0; i < list->nr; i++) |
| 186 | clearfunc(list->items[i].util, list->items[i].string); |
| 187 | } |
| 188 | if (list->strdup_strings) { |
| 189 | for (size_t i = 0; i < list->nr; i++) |
| 190 | free(list->items[i].string); |
| 191 | } |
| 192 | free(list->items); |
| 193 | } |
| 194 | list->items = NULL; |
| 195 | list->nr = list->alloc = 0; |
| 196 | } |
| 197 | |
| 198 | void string_list_setlen(struct string_list *list, size_t nr) |
| 199 | { |
no outgoing calls
no test coverage detected