diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-04-13 02:19:08 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-04-13 02:19:08 +0000 |
commit | 57459439db1f48dbbace1ab059117798fa26d203 (patch) | |
tree | 537c15504b977b30af126ff4f9425c690672dc93 /src/libdatastruct/gensetdyn_deepfree.c | |
parent | 564c6ba2f899a4b530d58f6ac123e31d6b797fe2 (diff) | |
download | skalibs-57459439db1f48dbbace1ab059117798fa26d203.tar.xz |
Add genset[dyn]_deepfree
Diffstat (limited to 'src/libdatastruct/gensetdyn_deepfree.c')
-rw-r--r-- | src/libdatastruct/gensetdyn_deepfree.c | 17 |
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) ; +} |