--- /dev/null
+/* vi: set et sw=4 ts=4 cino=t0,(0: */
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of libsignon-glib
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation.
+ *
+ * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#include "signon-utils.h"
+
+static void signon_copy_gvalue (gchar *key,
+ GValue *value,
+ GHashTable *dest)
+{
+ GValue *copy_value = g_new0 (GValue, 1);
+ g_value_init (copy_value, value->g_type);
+ g_value_copy (value, copy_value);
+
+ g_hash_table_insert (dest, g_strdup(key), copy_value);
+}
+
+static void signon_free_gvalue (gpointer val)
+{
+ g_return_if_fail (G_IS_VALUE(val));
+
+ GValue* value = (GValue*)val;
+ g_value_unset (value);
+ g_free (value);
+}
+
+GHashTable *signon_copy_variant_map (const GHashTable *old_map)
+{
+ GHashTable* new_map = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free,
+ signon_free_gvalue);
+
+ g_hash_table_foreach ((GHashTable*)old_map,
+ (GHFunc)signon_copy_gvalue,
+ (gpointer)new_map);
+
+ return new_map;
+}
+
--- /dev/null
+/* vi: set et sw=4 ts=4 cino=t0,(0: */
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of libsignon-glib
+ *
+ * Copyright (C) 2009-2010 Nokia Corporation.
+ *
+ * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#ifndef _SIGNON_UTILS_H_
+#define _SIGNON_UTILS_H_
+
+#include <glib-object.h>
+
+GHashTable *signon_copy_variant_map (const GHashTable *old_map);
+
+#endif //_SIGNON_UTILS_H_