chiark / gitweb /
job: fix loss of ordering with restart jobs
[elogind.git] / src / hashmap.c
index 95ea45da4893662d42b569f16914acf6ec4101e9..6928118615ba48306f15b9afee225550a62ed758 100644 (file)
@@ -55,10 +55,10 @@ struct pool {
         unsigned n_used;
 };
 
-struct pool *first_hashmap_pool = NULL;
+static struct pool *first_hashmap_pool = NULL;
 static void *first_hashmap_tile = NULL;
 
-struct pool *first_entry_pool = NULL;
+static struct pool *first_entry_pool = NULL;
 static void *first_entry_tile = NULL;
 
 static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
@@ -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)