 |
API参考
|
16#ifndef BSL_MODULE_LIST_H
17#define BSL_MODULE_LIST_H
38#define LIST_INIT(head) (head)->next = (head)->prev = (head)
47#define LIST_ADD_AFTER(where, item) do { \
48 (item)->next = (where)->next; \
49 (item)->prev = (where); \
50 (where)->next = (item); \
51 (item)->next->prev = (item); \
61#define LIST_ADD_BEFORE(where, item) LIST_ADD_AFTER((where)->prev, (item))
68#define LIST_REMOVE(item) do { \
69 (item)->prev->next = (item)->next; \
70 (item)->next->prev = (item)->prev; \
78#define LIST_IS_EMPTY(head) ((head)->next == (head))
87#define LIST_FOR_EACH_ITEM_SAFE(item, temp, head) \
88 for ((item) = (head)->next, (temp) = (item)->next; (item) != (head); (item) = (temp), (temp) = (item)->next)
112#define LIST_ENTRY(item, type, member) \
113 ((type *)((uintptr_t)(char *)(item) - (uintptr_t)(&((type *)0)->member)))
- bsl
- include
- bsl_module_list.h