From a6494a70ff56b4cfa172f9a4ec136338786478bc Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 9 Feb 2009 21:02:41 +0100 Subject: [PATCH] LibUCW: Added a function for assigning lists. --- ucw/clists.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ucw/clists.h b/ucw/clists.h index 2be40881..17d22017 100644 --- a/ucw/clists.h +++ b/ucw/clists.h @@ -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. **/ -- 2.39.5