55 if (root->
str) free (root->
str);
67 s->
str = str ? strdup (str) : NULL;
86 s->
str = str ? strdup (str) : NULL;
89 for (e = root; e->
next != NULL; e = e->
next) ;
100 for (
struct strlist_t *
s = root;
s != NULL;
s =
s->next) res++;
108 if (
s->str != NULL && str != NULL && !strcmp (
s->str, str))
118 for (
struct strlist_t *
s = root;
s != NULL;
s =
s->next, res++) {
119 if (
s->str != NULL && str != NULL && !strcmp (
s->str, str))
129 for (
int i = 0;
i < pos && s != NULL; s = s->
next,
i++) ;
130 return s ? s->
str : NULL;
137 for (s = root; s != NULL && s->
next != NULL; s = s->
next) ;
138 return s ? s->
str : NULL;
145 return s ? s->
str : NULL;
151 if (cand == NULL)
return;
157 if (root->
str) free (root->
str);
168 for (
int i = 0; post != NULL &&
i < post->
length ();
i++)
176 if (txt) { free (txt); txt = NULL; }
179 char *
t =
s->str ?
s->str : (
char *)
"(null)";
180 int len = strlen (t);
181 size += len + strlen (concat) + 1;
182 txt = (
char *) (txt ? realloc (txt, size) : malloc (size));
183 txt = (
s == root) ? strcpy (txt, t) : strcat (txt, t);
184 txt = strcat (txt, concat);
186 if (txt) txt[strlen (txt) - 1] =
'\0';
187 return txt ? txt : (
char *)
"";
207 _first = _last = _current = NULL;
216 return _strlist->
length ();
221 _current = _first = _strlist->root;
222 return _current ? _current->
str : NULL;
227 for (_last = _strlist->root; _last && _last->
next; _last = _last->
next) ;
229 return _current ? _current->
str : NULL;
234 _current = _current->
next;
235 return _current ? _current->
str : NULL;
240 return _current ? _current->
str : NULL;
245 return _first ? _first->
str : NULL;
250 return _last ? _last->
str : NULL;