[or-cvs] Add strmap_isempty
Nick Mathewson
nickm at seul.org
Tue Aug 17 06:28:41 UTC 2004
Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv24565/src/common
Modified Files:
util.c util.h
Log Message:
Add strmap_isempty
Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- util.c 16 Aug 2004 20:46:00 -0000 1.124
+++ util.c 17 Aug 2004 06:28:34 -0000 1.125
@@ -740,6 +740,11 @@
tor_free(map);
}
+int strmap_isempty(strmap_t *map)
+{
+ return SPLAY_EMPTY(&map->head);
+}
+
/*
* String manipulation
*/
Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- util.h 16 Aug 2004 20:46:00 -0000 1.81
+++ util.h 17 Aug 2004 06:28:34 -0000 1.82
@@ -181,6 +181,7 @@
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);
More information about the tor-commits
mailing list