diff options
Diffstat (limited to 'src/libdatastruct/genset_deepfree.c')
-rw-r--r-- | src/libdatastruct/genset_deepfree.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libdatastruct/genset_deepfree.c b/src/libdatastruct/genset_deepfree.c new file mode 100644 index 0000000..e219344 --- /dev/null +++ b/src/libdatastruct/genset_deepfree.c @@ -0,0 +1,16 @@ +/* ISC license. */ + +#include <skalibs/functypes.h> +#include <skalibs/genset.h> + +static int freeiter (char *s, void *aux) +{ + freefunc_t_ref f = aux ; + (*f)((void *)s) ; + return 1 ; +} + +void genset_deepfree (genset *g, freefunc_t_ref f) +{ + genset_iter(g, &freeiter, f) ; +} |