X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fclists.h;h=9c0f816a201e13175486c611092e700887d1dce4;hb=8ab69f51fccccbcae521bd7f7e3ae27146fd1217;hp=846752fcce3cd9b2ada471e2208fb86c1dea082d;hpb=02c66f9ec998f483accc05fd5bf67609e73e333f;p=libucw.git 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