summaryrefslogtreecommitdiff
path: root/src/libdatastruct/genqdyn_clean.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdatastruct/genqdyn_clean.c')
-rw-r--r--src/libdatastruct/genqdyn_clean.c11
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 ;
+}