4 This file is part of polypaudio.
6 polypaudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2 of the License,
9 or (at your option) any later version.
11 polypaudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with polypaudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29 #include <polyp/xmalloc.h>
31 #include <polypcore/strbuf.h>
32 #include <polypcore/core-util.h>
41 pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s) {
44 n = pa_xmalloc(sizeof(pa_strlist));
45 n->str = pa_xstrdup(s);
50 char *pa_strlist_tostring(pa_strlist *l) {
55 for (; l; l = l->next) {
57 pa_strbuf_puts(b, " ");
59 pa_strbuf_puts(b, l->str);
62 return pa_strbuf_tostring_free(b);
65 pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s) {
66 pa_strlist *ret = l, *prev = NULL;
70 if (!strcmp(l->str, s)) {
71 pa_strlist *n = l->next;
93 void pa_strlist_free(pa_strlist *l) {
103 pa_strlist* pa_strlist_pop(pa_strlist *l, char **s) {
118 pa_strlist* pa_strlist_parse(const char *s) {
119 pa_strlist *head = NULL, *p = NULL;
120 const char *state = NULL;
123 while ((r = pa_split_spaces(s, &state))) {
126 n = pa_xmalloc(sizeof(pa_strlist));