diff --git a/src/lib/llist.h b/src/lib/llist.h index 128a3e826..3cb70f8ea 100644 --- a/src/lib/llist.h +++ b/src/lib/llist.h @@ -306,6 +306,18 @@ LLIST_FUNC (LList llist_relocate (LList self), return self->next->prev = self->prev->next = self; ); +/** + * Move a node from one memory location to another. + * @param self target of the move, must be uninitialized or empty before this move + * @param source source of the move, will be initialized to a empty list after this call + * @return self + */ +LLIST_FUNC (LList llist_move (LList self, LList source), + *self = *source; + llist_init (source); + return llist_relocate (self); +); + /** * Insert a node after another. * @param self node after which we want to insert