zeroSquitto – Rev 1
?pathlinks?
/*************************************************************************/
/* Circular queue structure definition. */
/*************************************************************************/
typedef struct {
int size;
char **store;
int head, tail;
} CircularQueue;
/*************************************************************************/
/* Queue operations. */
/*************************************************************************/
extern CircularQueue *queueCreate(int size);
extern void queueEnqueue(CircularQueue *q, char *e);
extern char *queueDequeue(CircularQueue *q);
extern CircularQueue *queueClear(CircularQueue *q);
extern void queuePrint(CircularQueue *q);
/*************************************************************************/
/* Queue macros. */
/*************************************************************************/
/* Determines if the queue is empty. */
#define queueIsEmpty(q) (q->tail == q->head)
/* Returns the size of the allocated queue. */
#define queueSize(q) q->size
/* Returns the number of items in the queue. */
#define queueCount(q) q->tail - q->head