summaryrefslogtreecommitdiff
path: root/src/libdatastruct/genqdyn_unpush.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-03-16 12:31:17 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-03-16 12:31:17 +0000
commit6bae0b3d69c7968586afc73827b5844c6a23873f (patch)
tree03db0c9ff6dfa2a92ce90f26256426e4ef4404c7 /src/libdatastruct/genqdyn_unpush.c
parent4684272897e351ed21f82a0ef84bc94194b4d538 (diff)
downloadskalibs-6bae0b3d69c7968586afc73827b5844c6a23873f.tar.xz
Add genqdyn_unpush, bufalloc_unput
Diffstat (limited to 'src/libdatastruct/genqdyn_unpush.c')
-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 ;
+}