summaryrefslogtreecommitdiffstats
path: root/src/basic/hashmap.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-04-13 17:20:58 +0200
committerLennart Poettering <lennart@poettering.net>2021-05-25 15:47:09 +0200
commit641d3761d45c53000195ed4c6fff7d0d08cdc912 (patch)
treea7090921ee871d719f6ae9473b13c2cab5dbc664 /src/basic/hashmap.h
parentMerge pull request #19716 from yuwata/sd-netlink-NETLINK_GET_STRICT_CHK (diff)
downloadsystemd-641d3761d45c53000195ed4c6fff7d0d08cdc912.tar.xz
systemd-641d3761d45c53000195ed4c6fff7d0d08cdc912.zip
hashmap: add helper to test if iterator is still at beginning
Diffstat (limited to 'src/basic/hashmap.h')
-rw-r--r--src/basic/hashmap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/hashmap.h b/src/basic/hashmap.h
index c855f39b1d..f7ade2e774 100644
--- a/src/basic/hashmap.h
+++ b/src/basic/hashmap.h
@@ -51,6 +51,7 @@ typedef struct {
#define _IDX_ITERATOR_FIRST (UINT_MAX - 1)
#define ITERATOR_FIRST ((Iterator) { .idx = _IDX_ITERATOR_FIRST, .next_key = NULL })
+#define ITERATOR_IS_FIRST(i) ((i).idx == _IDX_ITERATOR_FIRST)
/* Macros for type checking */
#define PTR_COMPATIBLE_WITH_HASHMAP_BASE(h) \