diff options
Diffstat (limited to 'tumbler')
-rw-r--r-- | tumbler/tumbler-util.c | 26 | ||||
-rw-r--r-- | tumbler/tumbler-util.h | 4 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tumbler/tumbler-util.c b/tumbler/tumbler-util.c index c7be630..04c434d 100644 --- a/tumbler/tumbler-util.c +++ b/tumbler/tumbler-util.c @@ -59,6 +59,32 @@ tumbler_util_is_debug_logging_enabled (const gchar *log_domain) +void +tumbler_util_dump_strv (const gchar *log_domain, + const gchar *label, + const gchar *const *strv) +{ + GString *string; + const gchar *const *p; + + g_return_if_fail (label != NULL && strv != NULL); + + if (! tumbler_util_is_debug_logging_enabled (log_domain)) + return; + + string = g_string_new (label); + g_string_append (string, ":\n"); + + for (p = strv; *p != NULL; p++) + g_string_append_printf (string, " %s\n", *p); + + g_string_truncate (string, string->len - 1); + g_log (log_domain, G_LOG_LEVEL_DEBUG, "%s", string->str); + g_string_free (string, TRUE); +} + + + gchar ** tumbler_util_get_supported_uri_schemes (void) { diff --git a/tumbler/tumbler-util.h b/tumbler/tumbler-util.h index 037bcf3..20a0cc3 100644 --- a/tumbler/tumbler-util.h +++ b/tumbler/tumbler-util.h @@ -30,6 +30,10 @@ G_BEGIN_DECLS gboolean tumbler_util_is_debug_logging_enabled (const gchar *log_domain); +void tumbler_util_dump_strv (const gchar *log_domain, + const gchar *label, + const gchar *const *strv); + gchar **tumbler_util_get_supported_uri_schemes (void) G_GNUC_MALLOC; GKeyFile *tumbler_util_get_settings (void) G_GNUC_MALLOC; |