4 * linux-like bidirectional lists
9 /* not just a head, also the link field for a list entry */
11 struct list_head *prev, *next;
14 #define INIT_LIST_HEAD(l) do { (l)->prev = (l)->next = (l); } while (0)
15 #define list_empty(l) ( (l)->next == l )
17 __list_add(struct list_head *o, struct list_head *prev,
18 struct list_head *next)
27 list_add_tail(struct list_head *o, struct list_head *head)
29 __list_add(o, head->prev, head);
32 #define list_first_entry(pL, ty, member) \
33 (ty *)((char *)((pL)->next) - offsetof(ty, member))
36 __list_del(struct list_head *prev, struct list_head *next)
43 list_del(struct list_head *entry)
45 ND("called on %p", entry);
46 __list_del(entry->prev, entry->next);
47 entry->next = entry->prev = NULL;
50 #endif /* _MYLIST_H */