#ifndef _QUEUE_H #define _QUEUE_H #include "list.h" // queue relies on list to work // (which relies on node) struct queue { List *data; // pointer to list containing data Node *front; // pointer to node at front of queue Node *back; // pointer to node at back of queue int buffer; // maximum queue size (0 is unbounded) }; typedef struct queue Queue; // because we deserve nice things Queue *mkqueue(int ); // create new queue (of max size) Queue *cpqueue(Queue * ); // create a copy of an existing queue Queue *rmqueue(Queue * ); // clear and de-allocate an existing queue Queue *purge(Queue * ); // empty a given queue int enqueue(Queue **, Node * ); // add new node to the back of queue int dequeue(Queue **, Node **); // take off node at front of queue #endif