aboutsummaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-29 01:34:58 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-29 01:34:58 +0100
commit8eeb6f5836ee772e3cdc8967d20444d84261373e (patch)
treef7698ee243bcf995d1ced178e2c5591214b8cc1b /map.h
parent305337f6b968c36ed948b2eee6738f5ee42fc824 (diff)
downloadvis-8eeb6f5836ee772e3cdc8967d20444d84261373e.tar.gz
vis-8eeb6f5836ee772e3cdc8967d20444d84261373e.tar.xz
map: implement map_first
Diffstat (limited to 'map.h')
-rw-r--r--map.h2
1 files changed, 2 insertions, 0 deletions
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);