11 #define list_entry(ptr, type, member) \
12 (type*)((char*)(ptr) - offsetof(type, member))
14 #define STATIC_LIST_INITIALIZER(list) { &(list), &(list) }
26 if ((elem->
next != NULL) || (elem->
prev != NULL)) __builtin_trap();
36 if ((elem->
next != NULL) || (elem->
prev != NULL)) __builtin_trap();
48 if ((new_elem->
next != NULL) || (new_elem->
prev != NULL)) __builtin_trap();
51 new_elem->
prev = elem;
53 elem->
next = new_elem;
60 if ((new_elem->
next != NULL) || (new_elem->
prev != NULL)) __builtin_trap();
62 new_elem->
next = elem;
65 elem->
prev = new_elem;
85 return (list == list->
next);
89 return (elem != list);
static int is_valid_list_elem(LIST *list, LIST *elem)
static LIST * last_list_elem(LIST *list)
static void init_list(LIST *list)
static LIST * first_list_elem(LIST *list)
static void add_to_list_back(LIST *list, LIST *elem)
static void insert_to_list_before(LIST *list, LIST *elem, LIST *new_elem)
static int is_list_empty(LIST *list)
static void replace_in_list(LIST *list, LIST *elem, LIST *new_elem)
static void add_to_list(LIST *list, LIST *elem)
static void insert_to_list_after(LIST *list, LIST *elem, LIST *new_elem)
static void remove_from_list(LIST *list, LIST *elem)