Queue Functions
Queues are implemented as linked lists in the generated code. Each node in the linked list contains a pointer to an element. Access the lists using the access functions described in the following table:
To remove an element from the head of the queue and put it into an element, use the following function. (The status is TRUE if there was an element to get. If the status is passed as NULL, no status value is returned.) To copy an element from the Q, use the following function. This is the same as Q_GET, except the TOP queue element is not removed from the queue it is only copied. To create your own queues, use the following function to initialize the queue before use. The queue starts empty.All queue manipulation is done using memory allocation for elements added to the queue and freeing the memory when the elements are removed or deleted from the queue. The memory allocation and freeing is done automatically so there is no need to preserve the value of element after the
Q_PUT()
orQ_UPUT()
procedure is called.The queue manipulation functions work through the update list, so if some elements are put into a queue, they are not in the queue until the end of the step.