ev_metadata_manager = NULL;
}
+static void
+value_free (gpointer data)
+{
+ GValue *value = (GValue *)data;
+
+ g_value_unset (value);
+ g_free (value);
+}
+
static GValue *
parse_value (xmlChar *value, xmlChar *type)
{
g_value_set_string (ret, (char *)value);
break;
case G_TYPE_INT:
- g_value_set_int (ret, atoi ((char *)value));
+ g_value_set_int (ret, g_ascii_strtoull ((char *)value, NULL, 0));
break;
case G_TYPE_DOUBLE:
g_value_set_double (ret, g_ascii_strtod ((char *)value, NULL));
break;
case G_TYPE_BOOLEAN:
- g_value_set_boolean (ret, atoi ((char *)value));
+ g_value_set_boolean (ret, g_ascii_strtoull ((char *)value, NULL, 0));
break;
}
item = g_new0 (Item, 1);
- item->atime = atol ((char *)atime);
+ item->atime = g_ascii_strtoull((char*)atime, NULL, 0);
item->values = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
- g_free);
+ value_free);
cur = cur->xmlChildrenNode;
xmlChar *key;
xmlChar *xml_value;
xmlChar *type;
- GValue *value;
+ GValue *value;
key = xmlGetProp (cur, (const xmlChar *)"key");
xml_value = xmlGetProp (cur, (const xmlChar *)"value");
if (key != NULL)
xmlFree (key);
+ if (type != NULL)
+ xmlFree (type);
if (xml_value != NULL)
xmlFree (xml_value);
}
cur = xmlDocGetRootElement (doc);
if (cur == NULL)
{
- g_message ("The metadata file '%s' is empty", METADATA_FILE);
+ g_message ("The metadata file ā%sā is empty", METADATA_FILE);
xmlFreeDoc (doc);
return FALSE;
if (xmlStrcmp (cur->name, (const xmlChar *) "metadata"))
{
- g_message ("File '%s' is of the wrong type", METADATA_FILE);
+ g_message ("File ā%sā is of the wrong type", METADATA_FILE);
xmlFreeDoc (doc);
return FALSE;
return TRUE;
}
-static void
-value_free (gpointer data)
-{
- GValue *value = (GValue *)data;
-
- g_value_unset (value);
- g_free (value);
-}
-
-
#define LAST_URI "last-used-value"
static gboolean
xmlSetProp (xml_node, (const xmlChar *)"uri", (const xmlChar *)key);
- /* FIXME: is the cast right? - Paolo */
- atime = g_strdup_printf ("%d", (int)item->atime);
- xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);
-
+ atime = g_strdup_printf ("%ld", item->atime);
+ xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);
g_free (atime);
g_hash_table_foreach (item->values,