#define CLIST_FOR_EACH_BACKWARDS(type,n,list) for(type n=(void*)(list).head.prev; (cnode*)(n) != &(list).head; n=(void*)((cnode*)(n))->prev)
/**
- * Insert a new node just after the node @after. To insert a new head, use @clist_add_head() instead.
+ * Insert a new node just after the node @after. To insert at the head of the list, use @clist_add_head() instead.
**/
static inline void clist_insert_after(cnode *what, cnode *after)
{
}
/**
- * Insert a new node just before the node @before. To insert a new tail, use @clist_add_tail() instead.
+ * Insert a new node just before the node @before. To insert at the tail of the list, use @clist_add_tail() instead.
**/
static inline void clist_insert_before(cnode *what, cnode *before)
{
}
}
+/**
+ * Move all items from a source list to a destination list. The source list
+ * becomes empty, the original contents of the destination list are destroyed.
+ **/
+static inline void clist_move(clist *to, clist *from)
+{
+ clist_init(to);
+ clist_insert_list_after(from, &to->head);
+ clist_init(from);
+}
+
/**
* Compute the number of nodes in @l. Beware linear time complexity.
**/