Merge with modular_map
[navit-package] / src / util.c
index 7f77ca2..44643d4 100644 (file)
@@ -1,3 +1,4 @@
+#include <glib.h>
 #include <ctype.h>
 #include "util.h"
 
@@ -17,3 +18,19 @@ strtolower(char *dest, const char *src)
        *dest='\0';
 }
 
+
+static void
+hash_callback(gpointer key, gpointer value, gpointer user_data)
+{
+       GList **l=user_data;
+       *l=g_list_prepend(*l, value);
+}
+
+GList *
+g_hash_to_list(GHashTable *h)
+{
+       GList *ret=NULL;
+       g_hash_table_foreach(h, hash_callback, &ret);
+
+       return ret;
+}