#include <glib.h>
#include <glib-object.h>
#include <string.h>
+#include <inttypes.h>
#include "values.h"
static void dict_delete_key(gpointer data);
{
str ="dict";
}
- g_debug("%s", str);
+ g_debug("Type %s", str);
+}
+
+void
+debug_show_value(GValue *gval)
+{
+ GType tp;
+
+ tp = G_VALUE_TYPE(gval);
+ if (tp == G_TYPE_STRING)
+ {
+ g_message("Type %s value %s", "string", g_value_get_string(gval));
+ }
+ else if (tp == G_TYPE_INT)
+ {
+ g_message("Type %s value %d", "int", g_value_get_int(gval));
+ }
+ else if (tp == G_TYPE_INT64)
+ {
+ g_message("Type %s value %" PRId64, "int64", g_value_get_int64(gval));
+ }
+ else if (tp == G_TYPE_DOUBLE)
+ {
+ g_message("Type %s value %f", "double", g_value_get_double(gval));
+ }
+ else if (tp == G_TYPE_BOOLEAN)
+ {
+ g_message("Type %s value %d", "boolean", g_value_get_boolean(gval));
+ }
+ else if (tp == ghb_array_get_type())
+ {
+ g_message("Type %s", "boolean");
+ }
+ else if (tp == ghb_dict_get_type())
+ {
+ g_message("Type %s", "dict");
+ }
}
gint
GType typa;
GType typb;
+ if ((vala == NULL && valb != NULL) || (vala != NULL && valb == NULL))
+ {
+ return 1;
+ }
typa = G_VALUE_TYPE(vala);
typb = G_VALUE_TYPE(valb);
if (typa != typb)
}
GValue*
-ghb_dict_lookup(GValue *gval, const gchar *key)
+ghb_dict_lookup(const GValue *gval, const gchar *key)
{
GHashTable *dict = g_value_get_boxed(gval);
return g_hash_table_lookup(dict, key);