Lines Matching refs:item
10 #define GET_ITEM(list, item) ((void *)((uint8_t *)item - list->offset))
11 #define GET_LINK(list, item) ((list_link *)((uint8_t *)item + list->offset))
102 /** Gets the successor for the current item. If the passed
103 * item is NULL, it returns the first entry in the list,
109 list_get_next_item(struct list *list, void *item)
113 if (item == NULL)
116 link = get_next_link(list, GET_LINK(list, item));
121 /** Gets the predecessor for the current item. If the passed
122 * item is NULL, it returns the last entry in the list,
128 list_get_prev_item(struct list *list, void *item)
132 if (item == NULL)
135 link = get_prev_link(list, GET_LINK(list, item));
147 /** Adds an item to the end of the list.
148 * Similar to list_add_link_to_tail() but works on the item, not the link.
152 list_add_item(struct list *list, void *item)
154 list_add_link_to_tail(list, GET_LINK(list, item));
158 /** Removes an item from the list.
159 * Similar to list_remove_link() but works on the item, not the link.
163 list_remove_item(struct list *list, void *item)
165 list_remove_link(GET_LINK(list, item));
169 /** Inserts an item before another item in the list.
170 * If you pass NULL as \a before item, the item is added at the end of
175 list_insert_item_before(struct list *list, void *before, void *item)
181 list_add_item(list, item);
186 link = GET_LINK(list, item);
196 /** Removes the first item in the list and returns it.
213 /** Removes the last item in the list and returns it.