From 05c204e675e8f6f497496170b8e69e37ed208450 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sat, 18 Jul 2015 19:43:49 +0200 Subject: Save updated keymap in memory Still need to write it out to disk as well... --- utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 9cb775b..fd9db77 100644 --- a/utils.h +++ b/utils.h @@ -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; -- cgit v1.2.3