summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2015-07-18 19:43:49 +0200
committerDavid Härdeman <david@hardeman.nu>2015-07-18 19:43:49 +0200
commit05c204e675e8f6f497496170b8e69e37ed208450 (patch)
tree5113537fc64eec34f9d7d36488f6639e38d6e085 /utils.h
parent17d201747727157b63aaaa956071f10e35ad9942 (diff)
Save updated keymap in memory
Still need to write it out to disk as well...
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h9
1 files changed, 9 insertions, 0 deletions
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;