From 2c52650872bdeede320c4192bc0ac06c029f2732 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 11 Mar 2008 19:29:12 +0000 Subject: added bt_string2list function --- common/glib-helper.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'common/glib-helper.c') diff --git a/common/glib-helper.c b/common/glib-helper.c index cb8f35c4..771b9d76 100644 --- a/common/glib-helper.c +++ b/common/glib-helper.c @@ -277,3 +277,27 @@ gchar *bt_list2string(GSList *list) return str; } + +GSList *bt_string2list(const gchar *str) +{ + GSList *l = NULL; + gchar **uuids; + int i = 0; + + if (!str) + return NULL; + + /* FIXME: eglib doesn't support g_strsplit */ + uuids = g_strsplit(str, " ", 0); + if (!uuids) + return NULL; + + while (uuids[i]) { + l = g_slist_append(l, uuids[i]); + i++; + } + + g_free(uuids); + + return l; +} -- cgit