From 63b35d002aa6902618235e1a30dca37de52ff65e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 17 Sep 2004 19:45:44 +0000 Subject: new configuration subsystem git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@210 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'polyp/util.c') diff --git a/polyp/util.c b/polyp/util.c index 24773a7b..86f18f25 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -390,6 +390,23 @@ char *pa_split(const char *c, const char *delimiter, const char**state) { return pa_xstrndup(current, l); } +#define WHITESPACE " \t\n" + +char *pa_split_spaces(const char *c, const char **state) { + const char *current = *state ? *state : c; + size_t l; + + if (*current) + return NULL; + + current += strspn(current, WHITESPACE); + l = strcspn(current, WHITESPACE); + + *state = current+l; + + return pa_xstrndup(current, l); +} + const char *pa_strsignal(int sig) { switch(sig) { case SIGINT: return "SIGINT"; -- cgit