7 #ifndef _ASTARTE_LIST_H_
8 #define _ASTARTE_LIST_H_
17 } __attribute__((deprecated(
"Please use the typedef astarte_list_head_t")));
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
22 #pragma GCC diagnostic pop
28 } __attribute__((deprecated(
"Please use the typedef astarte_ptr_list_entry_t")));
30 #pragma GCC diagnostic push
31 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
33 #pragma GCC diagnostic pop
41 #define GET_LIST_ENTRY(list_item, type, list_head_member) \
42 ((type *) (((char *) (list_item)) - ((unsigned long) &((type *) 0)->list_head_member)))
49 #define LIST_FOR_EACH(item, head) for (item = (head)->next; item != (head); item = item->next)
57 #define MUTABLE_LIST_FOR_EACH(item, tmp, head) \
58 for (item = (head)->next, tmp = item->next; item != (head); item = tmp, tmp = item->next)
68 static inline void astarte_list_insert(
71 new_item->prev = prev_head;
72 new_item->next = next_head;
73 next_head->prev = new_item;
74 prev_head->next = new_item;
88 astarte_list_insert(new_item, head->prev, head);
100 astarte_list_insert(new_item, head, head->next);
113 remove_item->prev->next = remove_item->next;
114 remove_item->next->prev = remove_item->prev;
137 return (list_item->next == list_item) && (list_item->prev == list_item);
Definition: astarte_list.h:14
Definition: astarte_list.h:25