free(h);
}
+void hashmap_free_free(Hashmap *h) {
+ void *p;
+
+ while ((p = hashmap_steal_first(h)))
+ free(p);
+
+ hashmap_free(h);
+}
+
void hashmap_clear(Hashmap *h) {
if (!h)
return;
return data;
}
+void* hashmap_steal_first_key(Hashmap *h) {
+ void *key;
+
+ if (!h)
+ return NULL;
+
+ if (!h->iterate_list_head)
+ return NULL;
+
+ key = (void*) h->iterate_list_head->key;
+ remove_entry(h, h->iterate_list_head);
+
+ return key;
+}
+
unsigned hashmap_size(Hashmap *h) {
if (!h)
return copy;
}
+
+char **hashmap_get_strv(Hashmap *h) {
+ char **sv;
+ Iterator it;
+ char *path;
+ int n;
+
+ sv = malloc((h->n_entries+1) * sizeof(char *));
+ if (sv == NULL)
+ return NULL;
+
+ n = 0;
+ HASHMAP_FOREACH(path, h, it)
+ sv[n++] = path;
+ sv[n] = NULL;
+
+ return sv;
+}