aboutsummaryrefslogtreecommitdiffstats
path: root/src/basecmd.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-11-20 18:57:47 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-12-04 16:10:13 -0500
commit697412d25c572d17821561db88abb992f944b18b (patch)
tree536ec4fd3bd4a7e9caabe4f0524d22707d3ed1f4 /src/basecmd.h
parent3b9412513ee2652bb3a7db67978e634864e72424 (diff)
downloadkutter-697412d25c572d17821561db88abb992f944b18b.tar.gz
kutter-697412d25c572d17821561db88abb992f944b18b.tar.xz
kutter-697412d25c572d17821561db88abb992f944b18b.zip
stepper: Use a reusable interface to the "move queue"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/basecmd.h')
-rw-r--r--src/basecmd.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/basecmd.h b/src/basecmd.h
index f4ea1cc7..a6464cad 100644
--- a/src/basecmd.h
+++ b/src/basecmd.h
@@ -4,10 +4,22 @@
#include <stddef.h> // size_t
#include <stdint.h> // uint8_t
+struct move_node {
+ struct move_node *next;
+};
+struct move_queue_head {
+ struct move_node *first, *last;
+};
+
void *alloc_chunk(size_t size);
void move_free(void *m);
void *move_alloc(void);
-void move_request_size(int size);
+int move_queue_empty(struct move_queue_head *mh);
+struct move_node *move_queue_first(struct move_queue_head *mh);
+int move_queue_push(struct move_node *m, struct move_queue_head *mh);
+struct move_node *move_queue_pop(struct move_queue_head *mh);
+void move_queue_clear(struct move_queue_head *mh);
+void move_queue_setup(struct move_queue_head *mh, int size);
void *oid_lookup(uint8_t oid, void *type);
void *oid_alloc(uint8_t oid, void *type, uint16_t size);
void *oid_next(uint8_t *i, void *type);