summaryrefslogtreecommitdiff
path: root/src/set.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-15 02:45:26 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-15 02:45:26 +0200
commit53ec43c61d2f0e19c41640c63ec034b2f8cedb89 (patch)
treeb541638dcdc95a7083a3db37fa1b693f1d8866a2 /src/set.c
parent3930341a76d2f13e25d59baba4eafaf075e8ffeb (diff)
set: introduce set_free_free()
Diffstat (limited to 'src/set.c')
-rw-r--r--src/set.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/set.c b/src/set.c
index efd20db536..a1aeb727a2 100644
--- a/src/set.c
+++ b/src/set.c
@@ -37,6 +37,15 @@ void set_free(Set* s) {
hashmap_free(MAKE_HASHMAP(s));
}
+void set_free_free(Set *s) {
+ void *p;
+
+ while ((p = set_steal_first(s)))
+ free(p);
+
+ set_free(s);
+}
+
int set_ensure_allocated(Set **s, hash_func_t hash_func, compare_func_t compare_func) {
return hashmap_ensure_allocated((Hashmap**) s, hash_func, compare_func);
}