diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-11 19:29:12 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-11 19:29:12 +0000 |
commit | 2c52650872bdeede320c4192bc0ac06c029f2732 (patch) | |
tree | 42ac66424371b29ffb9d25fb3e0fca2f34286401 /common/glib-helper.c | |
parent | f5b7c429b4d9fe8e83bf2e598e72084c83f77a0f (diff) |
added bt_string2list function
Diffstat (limited to 'common/glib-helper.c')
-rw-r--r-- | common/glib-helper.c | 24 |
1 files changed, 24 insertions, 0 deletions
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; +} |