]> wimlib.net Git - wimlib/blobdiff - src/list.h
Multithreaded compression (IN PROGRESS)
[wimlib] / src / list.h
index ff39710b1dec75761b98a66e2605f824aceaa5a4..2991f46a1fed17d0ec36cbf5e7cc750deaee17e4 100644 (file)
@@ -163,6 +163,29 @@ static inline void list_transfer(struct list_head *old,
        }
 }
 
+/**
+ * list_move - delete from one list and add as another's head
+ * @list: the entry to move
+ * @head: the head that will precede our entry
+ */
+static inline void list_move(struct list_head *list, struct list_head *head)
+{
+       list_del(list);
+       list_add(list, head);
+}
+
+/**
+ * list_move_tail - delete from one list and add as another's tail
+ * @list: the entry to move
+ * @head: the head that will follow our entry
+ */
+static inline void list_move_tail(struct list_head *list,
+                                 struct list_head *head)
+{
+       list_del(list);
+       list_add_tail(list, head);
+}
+
 /**
  * list_splice_tail - join two lists, each list being a queue
  * @list: the new list to add.