diff options
Diffstat (limited to 'lib/list/list.h')
-rw-r--r-- | lib/list/list.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/list/list.h b/lib/list/list.h index 53080a0..c8c5631 100644 --- a/lib/list/list.h +++ b/lib/list/list.h @@ -34,6 +34,13 @@ struct list { for (; &_pos->_member != &(_list)->head; \ _pos = list_entry(_pos->_member.next, typeof(*_pos), _member)) +#define STATIC_LIST(_list) static struct list _list = { \ + .head = { \ + .next = &_list.head, \ + .prev = &_list.head \ + } \ +} + void list_init(struct list *list); void list_insert_before(struct list_item *next, struct list_item *item); void list_insert_after(struct list_item *prev, struct list_item *item); |