/************************************************\ * Filename: queue.h * * minus stuff that's repeated in stack.h... -mdj * Author: Sue Bogar * * Date Written: 4/22/98 * * Date modified: 11/28/98 * * Section: 101 * * SSN: 123-45-6789 * * EMail: bogar@cs.umbc.edu * * * * Description: This file contains the function * * prototypes to work with queue.c. * * This set of functions provide the operations * * needed including adding an item to the queue, * * enqueue; deleting an item from the queue, * * dequeue; determining if the queue is empty and * * the printing the items in the queue. * * Since the queue is being implemented as a * * linked list, some functions needed for a list * * have been added to this file, although they * * would normally be found in the linked list * * header file. Those functions are CreateNode * * and GetData. * \************************************************/ #ifndef _queue_h #define _queue_h #include "stack.h" /****************** * Enqueue takes two pointers to nodePtrs, and a * nodePtr as arguments. The first argument will * contain the address of head, the second argument * will contain the address of tail, and the third * argument is a pointer to the node to be inserted. * Enqueue will insert the item at the end of the * queue. The addresses of head and tail are passed * into this function, because this function may * need to change the address held in head, and/or * the address held in tail. ******************/ void Enqueue (NODEPTR* headPtr, NODEPTR* tailPtr, NODEPTR temp); /****************** * Dequeue takes two pointers to NODEPTR as * its arguments. The first argument will * contain the address of head, the second * argument will contain the address of tail. * This function removes an item from the * queue and returns the data value stored * there. This function may also alter the * address held in either head and/or tail. ******************/ struct board * Dequeue (NODEPTR *headPtr, NODEPTR *tailPtr); /****************** * IsEmpty takes a NODEPTR as its first * argument, which is a pointer to the list, * known as head. It determines whether the * queue is empty and returns 1 (true) if * the queue is empty and 0 (false) if it * is not empty. ******************/ int IsEmpty (NODEPTR head); void PrintQueue (NODEPTR curr); #endif