diff options
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -30,6 +30,15 @@ static inline void list_add(struct list_head *new, struct list_head *list) list->next = new; } +static inline void list_replace(struct list_head *old, struct list_head *new) +{ + old->prev->next = new; + old->next->prev = new; + new->next = old->next; + new->prev = old->prev; + old->next = old->prev = NULL; +} + static inline bool list_empty(struct list_head *list) { return list->next == list; |