2 /* Helper functions for TAILQ functions defined in <sys/queue.h>
4 * Blame any implementation mistakes on Peter Hunnisett
5 * <hunnise@nortelnetworks.com>
8 #ifndef __WINE_DPLAYX_QUEUE_H
9 #define __WINE_DPLAYX_QUEUE_H
11 #include <sys/queue.h>
13 /* head - pointer to TAILQ_HEAD struct
14 * elm - how to find the next element
15 * field - to be concatenated to rc to compare with fieldToEqual
16 * fieldToEqual - The value that we're looking for
17 * rc - Variable to put the return code. Same type as (head)->tqh_first
19 #define TAILQ_FIND_ENTRY( head, elm, field, fieldToEqual, rc ) { \
20 (rc) = (head)->tqh_first; /* NULL head? */ \
24 /* What we're searching for? */ \
25 if( (rc)->field == (fieldToEqual) ) \
27 break; /* rc == correct element */ \
30 /* End of list check */ \
31 if( ( (rc) = (rc)->elm.tqe_next ) == (head)->tqh_first ) \
39 #endif /* __WINE_DPLAYX_QUEUE_H */