Lines Matching refs:sl
898 static errcode_t init_list(struct str_list *sl)
900 sl->num = 0;
901 sl->max = 0;
902 sl->list = malloc((sl->max+1) * sizeof(char *));
903 if (!sl->list)
905 sl->list[0] = 0;
909 static errcode_t push_string(struct str_list *sl, const char *str)
913 if (sl->num >= sl->max) {
914 sl->max += 2;
915 new_list = realloc(sl->list, (sl->max+1) * sizeof(char *));
918 sl->list = new_list;
920 sl->list[sl->num] = malloc(strlen(str)+1);
921 if (sl->list[sl->num] == 0)
923 strcpy(sl->list[sl->num], str);
924 sl->num++;
925 sl->list[sl->num] = 0;