Lines Matching defs:list
17 char **list;
23 * Initialize the string list abstraction.
25 static errcode_t init_list(struct profile_string_list *list)
27 list->num = 0;
28 list->max = 10;
29 list->list = malloc(list->max * sizeof (char *));
30 if (list->list == 0)
32 list->list[0] = 0;
38 * built up list in *ret_list if it is non-null.
40 static void end_list(struct profile_string_list *list, char ***ret_list)
44 if (list == 0)
48 *ret_list = list->list;
51 for (cp = list->list; *cp; cp++)
53 free(list->list);
55 list->num = list->max = 0;
56 list->list = 0;
60 * Add a string to the list.
62 static errcode_t add_to_list(struct profile_string_list *list, const char *str)
67 if (list->num+1 >= list->max) {
68 newmax = list->max + 10;
69 newlist = realloc(list->list, newmax * sizeof (char *));
72 list->max = newmax;
73 list->list = newlist;
79 list->list[list->num++] = newstr;
80 list->list[list->num] = 0;