}
+/* Remove element from list. */
+static inline void
+__list_del (list_t *prev, list_t *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
/* Remove element from list. */
static inline void
list_del (list_t *elem)
{
- elem->next->prev = elem->prev;
- elem->prev->next = elem->next;
+ __list_del (elem->prev, elem->next);
}
+/* delete from list, add to another list as head */
+static inline void
+list_move (list_t *elem, list_t *head)
+{
+ __list_del (elem->prev, elem->next);
+ list_add (elem, head);
+}
/* Join two lists. */
static inline void