diff --git a/src/queue.h b/src/queue.h index 797c173..3217698 100644 --- a/src/queue.h +++ b/src/queue.h @@ -12,6 +12,7 @@ // Let the compiler know there will be structs defined elsewhere: typedef struct queue queue; +// An enum which is used to state what type of data is being stored in a queueNode: typedef enum queueDataType { EVENT, @@ -20,6 +21,7 @@ typedef enum queueDataType OUTPUT_MESSAGE } queueDataType; +// A union for storing a pointer to all the types of data a queueNode may hold: typedef union queueData { outputMessage * outputMessage; @@ -27,6 +29,7 @@ typedef union queueData commandEvent * command; } queueData; +// A queue node, a singly-linked list node for our queue: typedef struct queueNode queueNode; typedef struct queueNode { @@ -35,6 +38,7 @@ typedef struct queueNode queueNode * next; } queueNode; +// A queue, with pointers to the head and tail of the linked list, and data for multi-threading, locking, and an item count. typedef struct queue { volatile bool lock;