add new API pa_strlist_reverse()

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1984 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-10-29 20:30:15 +00:00
parent 87be85618c
commit cc883852bc
2 changed files with 18 additions and 0 deletions

View file

@ -146,3 +146,18 @@ pa_strlist* pa_strlist_parse(const char *s) {
return head;
}
pa_strlist *pa_strlist_reverse(pa_strlist *l) {
pa_strlist *r = NULL;
while (l) {
pa_strlist *n;
n = l->next;
l->next = r;
r = l;
l = n;
}
return r;
}

View file

@ -46,4 +46,7 @@ pa_strlist* pa_strlist_pop(pa_strlist *l, char **s);
/* Parse a whitespace separated server list */
pa_strlist* pa_strlist_parse(const char *s);
/* Reverse string list */
pa_strlist *pa_strlist_reverse(pa_strlist *l);
#endif