Lines Matching refs:sl
46 StringList *sl;
48 sl = malloc(sizeof(StringList));
49 if (sl == NULL)
52 sl->sl_cur = 0;
53 sl->sl_max = _SL_CHUNKSIZE;
54 sl->sl_str = malloc(sl->sl_max * sizeof(char *));
55 if (sl->sl_str == NULL)
57 return sl;
65 sl_add(sl, name)
66 StringList *sl;
69 if (sl->sl_cur == sl->sl_max - 1) {
72 sl->sl_max += _SL_CHUNKSIZE;
74 string = realloc(sl->sl_str, sl->sl_max * sizeof(char *));
78 sl->sl_str = string;
80 sl->sl_str[sl->sl_cur++] = name;
89 sl_free(sl, all)
90 StringList *sl;
95 if (sl == NULL)
97 if (sl->sl_str) {
99 for (i = 0; i < sl->sl_cur; i++)
100 free(sl->sl_str[i]);
101 free(sl->sl_str);
103 free(sl);
111 sl_find(sl, name)
112 StringList *sl;
117 for (i = 0; i < sl->sl_cur; i++)
118 if (strcmp(sl->sl_str[i], name) == 0)
119 return sl->sl_str[i];