From cc883852bc3c71e2c5c04177a6e4d29af18e2045 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 29 Oct 2007 20:30:15 +0000 Subject: add new API pa_strlist_reverse() git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1984 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/strlist.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/pulsecore/strlist.c') diff --git a/src/pulsecore/strlist.c b/src/pulsecore/strlist.c index 792af0ff..ac83f6b1 100644 --- a/src/pulsecore/strlist.c +++ b/src/pulsecore/strlist.c @@ -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; +} -- cgit