/* * file: queue.h * * circular queue * */ #ifndef H_QUEUE #define H_QUEUE #include #include #include #define MAX_QUEUE_SIZE; // fixed upper bound on queue size struct fifo { int size, // number of items in queue // (size = -1 means error) front, // items added here back, // items removed from here data[MAX_QUEUE_SIZE]; // assume queue items are ints }// // Normally, front < back extern void initFifoQ (struct fifo* queue); extern void addFifoQ (struct fifo* queue, int item); // add to front of queue extern int IsEmptyFifoQ (struct fifo* queue); // returns 1 if empty, 0 else extern int popFifoQ (struct fifo* queue); // remove from back of queue // return -1 if empty queue #endif // end of queue.h