]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/clists.h
UCW::CGI: Bug fixes
[libucw.git] / ucw / clists.h
index 2be40881854318db27e49497643ed69d9ee6c7ba..17d2201793b6b250f5c03e8465bc39dd358580b1 100644 (file)
@@ -189,6 +189,17 @@ static inline void clist_insert_list_after(clist *what, cnode *after)
     }
 }
 
+/**
+ * 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.
  **/