From 6fb072f62c2f50118dd5cb377d10c76ece51e5fb Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sun, 4 Oct 2020 14:36:07 +0200 Subject: Setze srcut-Marker... --- queue.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'queue.c') diff --git a/queue.c b/queue.c index 2fb9c72..dab5bfb 100644 --- a/queue.c +++ b/queue.c @@ -6,6 +6,7 @@ /* Project */ #include "util.h" +/* --8<-- queue_type */ typedef int T; struct queue_item { @@ -16,13 +17,17 @@ struct queue_item { struct queue { struct queue_item *head, *tail; }; +/* -->8-- */ +/* --8<-- queue_init */ void queue_init(struct queue *queue) { queue->head = NULL; } +/* -->8-- */ +/* --8<-- queue_put */ void queue_put(struct queue *queue, T data) { @@ -41,7 +46,9 @@ queue_put(struct queue *queue, T data) else ERROR("out of memory"); } +/* -->8-- */ +/* --8<-- queue_get */ bool queue_get(struct queue *queue, T *data) { @@ -59,13 +66,17 @@ queue_get(struct queue *queue, T *data) else return false; } +/* -->8-- */ +/* --8<-- queue_empty */ bool queue_empty(struct queue *queue) { return queue->head == NULL; } +/* -->8-- */ +/* --8<-- queue_free */ void queue_free(struct queue *queue) { @@ -76,6 +87,7 @@ queue_free(struct queue *queue) free(item); } } +/* -->8-- */ int main() -- cgit v1.3