diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-29 14:16:27 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-29 14:16:27 +0000 |
commit | ed40369c8610914085d568ec57701a035bf8dd29 (patch) | |
tree | 26425c589b590306fbba48140fabdd0abe4877bf /src/libdatastruct/genqdyn_clean.c | |
parent | a8e40d0287f05f6e444035431b1cc7b340fe8d79 (diff) | |
download | skalibs-ed40369c8610914085d568ec57701a035bf8dd29.tar.xz |
Add genqdyn
Diffstat (limited to 'src/libdatastruct/genqdyn_clean.c')
-rw-r--r-- | src/libdatastruct/genqdyn_clean.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libdatastruct/genqdyn_clean.c b/src/libdatastruct/genqdyn_clean.c new file mode 100644 index 0000000..9564d51 --- /dev/null +++ b/src/libdatastruct/genqdyn_clean.c @@ -0,0 +1,11 @@ +/* ISC license. */ + +#include <string.h> +#include "genqdyn-internal.h" + +void genqdyn_clean (genqdyn *g) +{ + memmove(g->queue.s, g->queue.s + g->head, g->queue.len - g->head) ; + g->queue.len -= g->head ; + g->head = 0 ; +} |