summaryrefslogtreecommitdiff
path: root/src/libdatastruct/gensetdyn_deepfree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdatastruct/gensetdyn_deepfree.c')
-rw-r--r--src/libdatastruct/gensetdyn_deepfree.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libdatastruct/gensetdyn_deepfree.c b/src/libdatastruct/gensetdyn_deepfree.c
new file mode 100644
index 0000000..8822bc3
--- /dev/null
+++ b/src/libdatastruct/gensetdyn_deepfree.c
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+#include <skalibs/functypes.h>
+#include <skalibs/gensetdyn.h>
+
+static int freeiter (char *s, void *aux)
+{
+ freefunc_t_ref f = aux ;
+ (*f)((void *)s) ;
+ return 1 ;
+}
+
+void gensetdyn_deepfree (gensetdyn *g, freefunc_t_ref f)
+{
+ gensetdyn_iter(g, &freeiter, f) ;
+ gensetdyn_free(g) ;
+}