X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fhashmap.h;h=ab4363a7a3ae34230049accaf7e7b7465e512097;hb=1124fe6f01b1d59d016c238026f20380f38d98dc;hp=9f89d7c865af366cf64bf2b2995a2e76b2d225fd;hpb=66d9b3b59551a33398b2201662af5c8c17a367c9;p=elogind.git diff --git a/src/hashmap.h b/src/hashmap.h index 9f89d7c86..ab4363a7a 100644 --- a/src/hashmap.h +++ b/src/hashmap.h @@ -74,15 +74,18 @@ void hashmap_clear(Hashmap *h); void *hashmap_steal_first(Hashmap *h); void *hashmap_steal_first_key(Hashmap *h); void* hashmap_first(Hashmap *h); +void* hashmap_first_key(Hashmap *h); void* hashmap_last(Hashmap *h); +char **hashmap_get_strv(Hashmap *h); + #define HASHMAP_FOREACH(e, h, i) \ - for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (i) != ITERATOR_LAST; (e) = hashmap_iterate((h), &(i), NULL)) + for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (e); (e) = hashmap_iterate((h), &(i), NULL)) #define HASHMAP_FOREACH_KEY(e, k, h, i) \ - for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (i) != ITERATOR_LAST; (e) = hashmap_iterate((h), &(i), (const void**) &(k))) + for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (e); (e) = hashmap_iterate((h), &(i), (const void**) &(k))) #define HASHMAP_FOREACH_BACKWARDS(e, h, i) \ - for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (i) != ITERATOR_FIRST; (e) = hashmap_iterate_backwards((h), &(i), NULL)) + for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL)) #endif