mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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:
parent
87be85618c
commit
cc883852bc
2 changed files with 18 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue