mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
common/list: add WL_LIST_INIT() macro
This commit is contained in:
parent
71b4277852
commit
f071431266
1 changed files with 9 additions and 0 deletions
|
|
@ -20,4 +20,13 @@ wl_list_append(struct wl_list *list, struct wl_list *elm)
|
||||||
wl_list_insert(list->prev, elm);
|
wl_list_insert(list->prev, elm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WL_LIST_INIT() - initialize a list when defining it
|
||||||
|
* @head: pointer to the head of the list to be initialized
|
||||||
|
*
|
||||||
|
* For example, this can be used like this:
|
||||||
|
* static struct wl_list list = WL_LIST_INIT(&list);
|
||||||
|
*/
|
||||||
|
#define WL_LIST_INIT(head) {.prev = (head), .next = (head)}
|
||||||
|
|
||||||
#endif /* LABWC_LIST_H */
|
#endif /* LABWC_LIST_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue