|
|
UDI_QUEUE_INIT, UDI_QUEUE_EMPTY
Initialize queue; check if it's empty
#include <udi.h>#define UDI_QUEUE_INIT(listhead) \ ((listhead)->next = (listhead)->prev =(listhead)) #define UDI_QUEUE_EMPTY(listhead) \ ((listhead)->next == (listhead))ARGUMENTS listhead is a pointer to a list head element.
DESCRIPTION UDI_QUEUE_INIT initializes the queue's list head and must be called before any other operations are performed on the queue.
UDI_QUEUE_EMPTY is used to determine if the queue specified by listhead is empty, based on the boolean return value (non-zero if empty; zero if non-empty).
These macros must be called as if they, respectively, had the following functional interfaces:
void UDI_QUEUE_INIT ( udi_queue_t *listhead ); udi_boolean_t UDI_QUEUE_EMPTY ( udi_queue_t *listhead );