- Added a little more dll level debugging and small changes
[wine] / dlls / dplayx / dplayx_queue.h
1
2 /* Helper functions for TAILQ functions defined in <sys/queue.h> 
3  * 
4  * Blame any implementation mistakes on Peter Hunnisett
5  * <hunnise@nortelnetworks.com>
6  */
7
8 #ifndef __WINE_DPLAYX_QUEUE_H
9 #define __WINE_DPLAYX_QUEUE_H
10
11 #include <sys/queue.h>
12
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
18  */
19 #define TAILQ_FIND_ENTRY( head, elm, field, fieldToEqual, rc ) { \
20   (rc) = (head)->tqh_first; /* NULL head? */                    \
21                                                                  \
22   while( rc )                                                    \
23   {                                                              \
24       /* What we're searching for? */                            \
25       if( (rc)->field == (fieldToEqual) )                        \
26       {                                                          \
27         break; /* rc == correct element */                       \
28       }                                                          \
29                                                                  \
30       /* End of list check */                                    \
31       if( ( (rc) = (rc)->elm.tqe_next ) == (head)->tqh_first )   \
32       {                                                          \
33         rc = NULL;                                               \
34         break;                                                   \
35       }                                                          \
36   }                                                              \
37 }
38
39 #endif /* __WINE_DPLAYX_QUEUE_H */