summaryrefslogtreecommitdiff
path: root/src/libdatastruct/gensetdyn_delete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdatastruct/gensetdyn_delete.c')
-rw-r--r--src/libdatastruct/gensetdyn_delete.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libdatastruct/gensetdyn_delete.c b/src/libdatastruct/gensetdyn_delete.c
new file mode 100644
index 0000000..58aec05
--- /dev/null
+++ b/src/libdatastruct/gensetdyn_delete.c
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/genalloc.h>
+#include <skalibs/gensetdyn.h>
+
+int gensetdyn_delete (gensetdyn_ref g, unsigned int i)
+{
+ return (i >= g->storage.len) ? (errno = EINVAL, 0) :
+ genalloc_catb(unsigned int, &g->freelist, &i, 1) ;
+}