From: Martin Mares Date: Sat, 19 Nov 2005 14:22:44 +0000 (+0000) Subject: Added clist_insert_list_after(). X-Git-Tag: holmes-import~706 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7843026e97722a4cefd445c4c3eff28dd75c1727;p=libucw.git Added clist_insert_list_after(). --- diff --git a/lib/clists.h b/lib/clists.h index 846752fc..9c0f816a 100644 --- a/lib/clists.h +++ b/lib/clists.h @@ -90,4 +90,17 @@ static inline void clist_init(clist *l) head->next = head->prev = head; } +static inline void clist_insert_list_after(clist *what, cnode *after) +{ + if (!clist_empty(what)) + { + cnode *w = &what->head; + w->prev->next = after->next; + after->next->prev = w->prev; + w->next->prev = after; + after->next = w->next; + clist_init(what); + } +} + #endif