diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-10 20:01:52 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2008-03-10 20:01:52 +0000 |
commit | b583273d911d67eb202f3f367f18d4460913ad41 (patch) | |
tree | 4393c7a8d57a4f4b8a4eb1450f86bffe83130f9a /common/glib-helper.c | |
parent | f4662ad94310c08fd83e2cd9acd4ab0a03379cee (diff) |
added list2string function
Diffstat (limited to 'common/glib-helper.c')
-rw-r--r-- | common/glib-helper.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/glib-helper.c b/common/glib-helper.c index eef6ad8d..001bb4fc 100644 --- a/common/glib-helper.c +++ b/common/glib-helper.c @@ -257,3 +257,19 @@ char *bt_uuid2string(uuid_t *uuid) return str; } + +gchar *bt_list2string(GSList *list) +{ + GSList *l; + gchar *str = NULL; + + if (!list) + return NULL; + + str = g_strdup((const gchar *) list->data); + + for (l = list->next; l; l = l->next) + str = g_strconcat(str, ", " , (const gchar *) l->data, NULL); + + return str; +} |