summaryrefslogtreecommitdiff
path: root/src/libdatastruct/gensetdyn_delete.c
blob: cfa15cf5c75acdde54a83ca4be9273a96e3e5736 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <errno.h>
#include <skalibs/genalloc.h>
#include <skalibs/gensetdyn.h>

int gensetdyn_delete (gensetdyn *g, unsigned int i)
{
  return (i >= g->storage.len) ? (errno = EINVAL, 0) :
    genalloc_catb(unsigned int, &g->freelist, &i, 1) ;
}