queue_push()

Add an element to the tail of the queue.

Synopsis:

#include <hnm/queue.h>
 
bool queue_push(queue_Queue *queue, void *element)

Arguments:

queue

A pointer to the queue structure to which the element is being added.

element

A pointer to a specialized structure that contains a queue_Element structure as its first element. This element is added to the specified queue and its queue_Element members are updated.

Library:

libhnm

Description:

Given a queue_Element data structure, the queue_push() function adds the enclosing data structure to the specified queue. This operation is performed in constant O(1) time. The queue_Element structure that adorns the enclosing structure as well as the queue structure itself are updated accordingly.

Note that an element can only ever be a member of a single queue. If the supplied element is already a member of another queue, the push operation will fail.

Returns:

A flag indicating whether the element was (true) or was not (false) successfully added to the queue.