summaryrefslogtreecommitdiff
path: root/src/libdatastruct/gensetdyn_deepfree.c
blob: 623120f46266ca09be337ab25a7ee21b5d331729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* ISC license. */

#include <skalibs/functypes.h>
#include <skalibs/gensetdyn.h>

static int freeiter (void *s, void *aux)
{
  free_func_ref f = aux ;
  (*f)(s) ;
  return 1 ;
}

void gensetdyn_deepfree (gensetdyn *g, free_func_ref f)
{
  gensetdyn_iter(g, &freeiter, f) ;
  gensetdyn_free(g) ;
}