Lines Matching refs:list
18 static int string_list_add(struct string_list *list, const char *str) in string_list_add() argument
25 if (len >= list->cap - list->len) { in string_list_add()
27 size_t new_cap = list->cap * 2; in string_list_add()
29 if (new_cap < list->len + len + 1) in string_list_add()
30 new_cap = list->len + len + 1; in string_list_add()
31 new_buffer = realloc(list->buffer, new_cap); in string_list_add()
34 list->buffer = new_buffer; in string_list_add()
35 list->cap = new_cap; in string_list_add()
37 memcpy(list->buffer + list->len, str, len); in string_list_add()
38 list->len += len; in string_list_add()
39 list->buffer[list->len] = '\0'; in string_list_add()
57 struct string_list list = { 0 }; in ipc_list_devices() local
61 ret = kernel_get_wireguard_interfaces(&list); in ipc_list_devices()
65 ret = userspace_get_wireguard_interfaces(&list); in ipc_list_devices()
72 free(list.buffer); in ipc_list_devices()
75 return list.buffer ?: strdup("\0"); in ipc_list_devices()