/* gcc `pkg-config --cflags --libs glib-2.0` test.c -o test */
#include <glib.h>

  GHashTable *table;

void
value_destroy_notify(void *value)
{
  g_hash_table_remove(table, value);
}


int
main()
{
  int i;

  table = g_hash_table_new_full(g_direct_hash,
                                g_direct_equal,
                                NULL,
                                value_destroy_notify);

  for (i = 0; i < 100; i += 2) {
    g_hash_table_insert(table, (gpointer) i, (gpointer) i+1);
    g_hash_table_insert(table, (gpointer) i+1, (gpointer) i);
  }

  g_hash_table_remove_all(table);
}
