21 #ifndef __WINE_SERVER_LIST_H 22 #define __WINE_SERVER_LIST_H 25 #define __WINE_SERVER_LIST_INLINE inline 28 #define __WINE_SERVER_LIST_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) 29 #elif defined(_MSC_VER) 30 #define __WINE_SERVER_LIST_INLINE __inline 32 #define __WINE_SERVER_LIST_INLINE static 82 elem->next->prev = to_add;
91 elem->prev->next = to_add;
168 dst->prev->next =
src->next;
169 src->next->prev =
dst->prev;
180 dst->next->prev =
src->prev;
181 src->prev->next =
dst->next;
188 #define LIST_FOR_EACH(cursor,list) \ 189 for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next) 192 #define LIST_FOR_EACH_SAFE(cursor, cursor2, list) \ 193 for ((cursor) = (list)->next, (cursor2) = (cursor)->next; \ 194 (cursor) != (list); \ 195 (cursor) = (cursor2), (cursor2) = (cursor)->next) 198 #define LIST_FOR_EACH_ENTRY(elem, list, type, field) \ 199 for ((elem) = LIST_ENTRY((list)->next, type, field); \ 200 &(elem)->field != (list); \ 201 (elem) = LIST_ENTRY((elem)->field.next, type, field)) 204 #define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \ 205 for ((cursor) = LIST_ENTRY((list)->next, type, field), \ 206 (cursor2) = LIST_ENTRY((cursor)->field.next, type, field); \ 207 &(cursor)->field != (list); \ 208 (cursor) = (cursor2), \ 209 (cursor2) = LIST_ENTRY((cursor)->field.next, type, field)) 212 #define LIST_FOR_EACH_REV(cursor,list) \ 213 for ((cursor) = (list)->prev; (cursor) != (list); (cursor) = (cursor)->prev) 216 #define LIST_FOR_EACH_SAFE_REV(cursor, cursor2, list) \ 217 for ((cursor) = (list)->prev, (cursor2) = (cursor)->prev; \ 218 (cursor) != (list); \ 219 (cursor) = (cursor2), (cursor2) = (cursor)->prev) 222 #define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \ 223 for ((elem) = LIST_ENTRY((list)->prev, type, field); \ 224 &(elem)->field != (list); \ 225 (elem) = LIST_ENTRY((elem)->field.prev, type, field)) 228 #define LIST_FOR_EACH_ENTRY_SAFE_REV(cursor, cursor2, list, type, field) \ 229 for ((cursor) = LIST_ENTRY((list)->prev, type, field), \ 230 (cursor2) = LIST_ENTRY((cursor)->field.prev, type, field); \ 231 &(cursor)->field != (list); \ 232 (cursor) = (cursor2), \ 233 (cursor2) = LIST_ENTRY((cursor)->field.prev, type, field)) 236 #define LIST_INIT(list) { &(list), &(list) } 240 #define LIST_ENTRY(elem, type, field) \ 241 ((type *)((char *)(elem) - (unsigned long long)(&((type *)0)->field))) 243 #define LIST_ENTRY(elem, type, field) \ 244 ((type *)((char *)(elem) - (unsigned long)(&((type *)0)->field)))
__WINE_SERVER_LIST_INLINE struct list * list_prev(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE void list_add_after(struct list *elem, struct list *to_add)
GLuint GLuint GLsizei count
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
__WINE_SERVER_LIST_INLINE void list_move_tail(struct list *dst, struct list *src)
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
#define __WINE_SERVER_LIST_INLINE