From 2e4a6ff47b311216829ed0f48f17ee9bc35641dc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 19 Dec 2011 19:54:51 +0100 Subject: hashmap: add hashmap_first_key() --- src/hashmap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/hashmap.c') diff --git a/src/hashmap.c b/src/hashmap.c index 95ea45da48..7ef809746d 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -558,6 +558,17 @@ void* hashmap_first(Hashmap *h) { return h->iterate_list_head->value; } +void* hashmap_first_key(Hashmap *h) { + + if (!h) + return NULL; + + if (!h->iterate_list_head) + return NULL; + + return (void*) h->iterate_list_head->key; +} + void* hashmap_last(Hashmap *h) { if (!h) -- cgit v1.2.3-54-g00ecf