]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/strlist.c
core: Link virtual sinks and sources to their streams.
[pulseaudio] / src / pulsecore / strlist.c
index 1fcb04512d8bfabf32630649ced639f41473239e..0f4ca86730fc735fb494b8fe4e243ebb9b55f88f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
@@ -7,7 +5,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
+  by the Free Software Foundation; either version 2.1 of the License,
   or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -44,7 +42,7 @@ struct pa_strlist {
 pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s) {
     pa_strlist *n;
     size_t size;
-    
+
     pa_assert(s);
     size = strlen(s);
     n = pa_xmalloc(PA_ALIGN(sizeof(pa_strlist)) + size + 1);
@@ -108,7 +106,7 @@ void pa_strlist_free(pa_strlist *l) {
 
 pa_strlist* pa_strlist_pop(pa_strlist *l, char **s) {
     pa_strlist *r;
-    
+
     pa_assert(s);
 
     if (!l) {
@@ -146,3 +144,30 @@ 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;
+}
+
+pa_strlist *pa_strlist_next(pa_strlist *s) {
+    pa_assert(s);
+
+    return s->next;
+}
+
+const char *pa_strlist_data(pa_strlist *s) {
+    pa_assert(s);
+
+    return ITEM_TO_TEXT(s);
+}