summaryrefslogtreecommitdiff
path: root/src/libdatastruct
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdatastruct')
-rw-r--r--src/libdatastruct/genqdyn_unpush.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libdatastruct/genqdyn_unpush.c b/src/libdatastruct/genqdyn_unpush.c
new file mode 100644
index 0000000..10100c9
--- /dev/null
+++ b/src/libdatastruct/genqdyn_unpush.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <skalibs/errno.h>
+#include <skalibs/stralloc.h>
+#include <skalibs/genqdyn.h>
+
+int genqdyn_unpush (genqdyn *g)
+{
+ if (g->queue.len < g->esize) return (errno = EINVAL, 0) ;
+ g->queue.len -= g->esize ;
+ return 1 ;
+}