]> mj.ucw.cz Git - libucw.git/blobdiff - lib/clists.h
added declaration and initialization of sections
[libucw.git] / lib / clists.h
index 846752fcce3cd9b2ada471e2208fb86c1dea082d..9c0f816a201e13175486c611092e700887d1dce4 100644 (file)
@@ -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