DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

udi_dequeue(3udi)


Dequeue a queue element

SYNOPSIS

#include <udi.h>

udi_queue_t *udi_dequeue (

udi_queue_t *element );

ARGUMENTS element is a pointer to a queue element

DESCRIPTION udi_dequeue removes element from its queue and returns it in the function return. The specified element must be linked into a UDI queue at the time udi_dequeue is called, and must not be the list head.

The next and prev fields of element are not modified.

udi_dequeue shall be equivalent to the following implementation:

udi_queue_t *udi_dequeue(

	udi_queue_t *element)

{

	element->next->prev = element->prev;

	element->prev->next = element->next;

	return element;

}
 

RETURN VALUES The element passed in is returned.

REFERENCES udi_enqueue, udi_queue_t

21.2.3 Queuing Macros

The macros defined in this section are general queue management macros used for the queuing of arbitrary structures linked together via embedded udi_queue_t structures. The behavior is indeterminate if the listhead passed to any of these macros other than UDI_QUEUE_INIT has not been previously initialized with UDI_QUEUE_INIT, or if the element or old_el parameter passed to any of the macros other than UDI_ENQUEUE_HEAD/TAIL and UDI_QUEUE_FOREACH is not currently linked into a UDI queue.


UDI Core Specification Contents