21#ifndef __WINE_SERVER_LIST_H
22#define __WINE_SERVER_LIST_H
27#define __WINE_SERVER_LIST_INLINE inline
30#define __WINE_SERVER_LIST_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
31#elif defined(_MSC_VER)
32#define __WINE_SERVER_LIST_INLINE __inline
34#define __WINE_SERVER_LIST_INLINE static
84 elem->next->prev = to_add;
93 elem->prev->next = to_add;
170 dst->prev->next =
src->next;
171 src->next->prev =
dst->prev;
182 dst->next->prev =
src->prev;
183 src->prev->next =
dst->next;
210 end->next = dst_next;
219 dst_prev->
next = begin;
221 begin->
prev = dst_prev;
226#define LIST_FOR_EACH(cursor,list) \
227 for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
230#define LIST_FOR_EACH_SAFE(cursor, cursor2, list) \
231 for ((cursor) = (list)->next, (cursor2) = (cursor)->next; \
232 (cursor) != (list); \
233 (cursor) = (cursor2), (cursor2) = (cursor)->next)
236#define LIST_FOR_EACH_ENTRY(elem, list, type, field) \
237 for ((elem) = LIST_ENTRY((list)->next, type, field); \
238 &(elem)->field != (list); \
239 (elem) = LIST_ENTRY((elem)->field.next, type, field))
242#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \
243 for ((cursor) = LIST_ENTRY((list)->next, type, field), \
244 (cursor2) = LIST_ENTRY((cursor)->field.next, type, field); \
245 &(cursor)->field != (list); \
246 (cursor) = (cursor2), \
247 (cursor2) = LIST_ENTRY((cursor)->field.next, type, field))
250#define LIST_FOR_EACH_REV(cursor,list) \
251 for ((cursor) = (list)->prev; (cursor) != (list); (cursor) = (cursor)->prev)
254#define LIST_FOR_EACH_SAFE_REV(cursor, cursor2, list) \
255 for ((cursor) = (list)->prev, (cursor2) = (cursor)->prev; \
256 (cursor) != (list); \
257 (cursor) = (cursor2), (cursor2) = (cursor)->prev)
260#define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \
261 for ((elem) = LIST_ENTRY((list)->prev, type, field); \
262 &(elem)->field != (list); \
263 (elem) = LIST_ENTRY((elem)->field.prev, type, field))
266#define LIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field) \
267 for ((cursor) = LIST_ENTRY((list)->prev, type, field), \
268 (cursor2) = LIST_ENTRY((cursor)->field.prev, type, field); \
269 &(cursor)->field != (list); \
270 (cursor) = (cursor2), \
271 (cursor2) = LIST_ENTRY((cursor)->field.prev, type, field))
274#define LIST_INIT(list) { &(list), &(list) }
278#define LIST_ENTRY(elem, type, field) \
279 ((type *)((char *)(elem) - (unsigned long long)(&((type *)0)->field)))
281#define LIST_ENTRY(elem, type, field) \
282 ((type *)((char *)(elem) - (unsigned long)(&((type *)0)->field)))
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static void list_move_tail(struct list_head *list, struct list_head *head)
GLuint GLuint GLsizei count
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
__WINE_SERVER_LIST_INLINE void list_move_after(struct list *dst, struct list *src)
__WINE_SERVER_LIST_INLINE struct list * list_prev(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE void list_move_slice_head(struct list *dst, struct list *begin, struct list *end)
#define __WINE_SERVER_LIST_INLINE
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE void list_move_before(struct list *dst, struct list *src)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
__WINE_SERVER_LIST_INLINE void list_add_after(struct list *elem, struct list *to_add)
__WINE_SERVER_LIST_INLINE void list_move_slice_tail(struct list *dst, struct list *begin, struct list *end)
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)