diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/util.c | 5 | ||||
-rw-r--r-- | src/common/util.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 68d858e82..ff2b02371 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -740,6 +740,11 @@ void strmap_free(strmap_t *map, void (*free_val)(void*)) tor_free(map); } +int strmap_isempty(strmap_t *map) +{ + return SPLAY_EMPTY(&map->head); +} + /* * String manipulation */ diff --git a/src/common/util.h b/src/common/util.h index 915fb9d9a..4c629a221 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -181,6 +181,7 @@ void* strmap_remove_lc(strmap_t *map, const char *key); typedef void* (*strmap_foreach_fn)(const char *key, void *val, void *data); void strmap_foreach(strmap_t *map, strmap_foreach_fn fn, void *data); void strmap_free(strmap_t *map, void (*free_val)(void*)); +int strmap_isempty(strmap_t *map); strmap_iter_t *strmap_iter_init(strmap_t *map); strmap_iter_t *strmap_iter_next(strmap_t *map, strmap_iter_t *iter); |