From 8eeb6f5836ee772e3cdc8967d20444d84261373e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 29 Dec 2016 01:34:58 +0100 Subject: map: implement map_first --- map.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'map.h') diff --git a/map.h b/map.h index 816e537..ca7bd44 100644 --- a/map.h +++ b/map.h @@ -9,6 +9,8 @@ typedef struct Map Map; Map *map_new(void); /* Retrieves a value, or NULL if it isn't in the map */ void *map_get(const Map*, const char *key); +/* Get first element of the map, or NULL if empty */ +void *map_first(const Map*, const char **key); /* Returns the corresponding value if the given prefix is unique. * Otherwise NULL, if no such prefix exists then errno is set to ENOENT. */ void *map_closest(const Map*, const char *prefix); -- cgit v1.2.3