about summary refs log tree commit diff
path: root/src/libdatastruct/gensetdyn_delete.c
blob: 5dcd0d90b0dee9137efc15bd2096e2bc46b5b0d9 (plain) (blame)
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, uint32_t i)
{
  return (i >= g->storage.len) ? (errno = EINVAL, 0) :
    genalloc_catb(uint32_t, &g->freelist, &i, 1) ;
}