aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-08-17 06:28:34 +0000
committerNick Mathewson <nickm@torproject.org>2004-08-17 06:28:34 +0000
commit8566bbb4892f81704c87543487f12b6433602240 (patch)
tree1395b4a813e144586a22a3b1ab0447d115cace16 /src
parentee23b7a470c6bc0f5cf08ea2ca13d541626de6b6 (diff)
downloadtor-8566bbb4892f81704c87543487f12b6433602240.tar
tor-8566bbb4892f81704c87543487f12b6433602240.tar.gz
Add strmap_isempty
svn:r2250
Diffstat (limited to 'src')
-rw-r--r--src/common/util.c5
-rw-r--r--src/common/util.h1
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);