I'm using GLib Hash Table. I'm trying to get the current value of the key that I found and then increment its value. I'm not quite sure how can I replace the existing value.
typedef struct {
gchar *key;
guint my_int;
} my_struct;
char *v;
v = g_hash_table_lookup(table, my_struct.key);
if (v == NULL)
g_hash_table_insert(table, g_strdup(my_struct.key), (gpointer)(my_struct.my_int));
else
g_hash_table_replace() // here I'd like to do something like current_val+1
Any ideas will be appreciate it.