From 6bae0b3d69c7968586afc73827b5844c6a23873f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 16 Mar 2018 12:31:17 +0000 Subject: Add genqdyn_unpush, bufalloc_unput --- src/libdatastruct/genqdyn_unpush.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/libdatastruct/genqdyn_unpush.c (limited to 'src/libdatastruct') 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 +#include +#include + +int genqdyn_unpush (genqdyn *g) +{ + if (g->queue.len < g->esize) return (errno = EINVAL, 0) ; + g->queue.len -= g->esize ; + return 1 ; +} -- cgit v1.2.3