+static inline void
+exec_node_init(struct exec_node *n)
+{
+ n->next = NULL;
+ n->prev = NULL;
+}
+
+static inline const struct exec_node *
+exec_node_get_next_const(const struct exec_node *n)
+{
+ return n->next;
+}
+
+static inline struct exec_node *
+exec_node_get_next(struct exec_node *n)
+{
+ return n->next;
+}
+
+static inline const struct exec_node *
+exec_node_get_prev_const(const struct exec_node *n)
+{
+ return n->prev;
+}
+
+static inline struct exec_node *
+exec_node_get_prev(struct exec_node *n)
+{
+ return n->prev;
+}
+
+static inline void
+exec_node_remove(struct exec_node *n)
+{
+ n->next->prev = n->prev;
+ n->prev->next = n->next;
+ n->next = NULL;
+ n->prev = NULL;
+}
+
+static inline void
+exec_node_self_link(struct exec_node *n)
+{
+ n->next = n;
+ n->prev = n;
+}
+
+static inline void
+exec_node_insert_after(struct exec_node *n, struct exec_node *after)
+{
+ after->next = n->next;
+ after->prev = n;
+
+ n->next->prev = after;
+ n->next = after;
+}
+
+static inline void
+exec_node_insert_node_before(struct exec_node *n, struct exec_node *before)
+{
+ before->next = n;
+ before->prev = n->prev;
+
+ n->prev->next = before;
+ n->prev = before;
+}
+
+static inline void
+exec_node_replace_with(struct exec_node *n, struct exec_node *replacement)
+{
+ replacement->prev = n->prev;
+ replacement->next = n->next;
+
+ n->prev->next = replacement;
+ n->next->prev = replacement;
+}
+
+static inline bool
+exec_node_is_tail_sentinel(const struct exec_node *n)
+{
+ return n->next == NULL;
+}
+
+static inline bool
+exec_node_is_head_sentinel(const struct exec_node *n)
+{
+ return n->prev == NULL;
+}
+
+#ifdef __cplusplus
+inline const exec_node *exec_node::get_next() const
+{
+ return exec_node_get_next_const(this);
+}
+
+inline exec_node *exec_node::get_next()
+{
+ return exec_node_get_next(this);
+}
+
+inline const exec_node *exec_node::get_prev() const
+{
+ return exec_node_get_prev_const(this);
+}
+
+inline exec_node *exec_node::get_prev()
+{
+ return exec_node_get_prev(this);
+}
+
+inline void exec_node::remove()
+{
+ exec_node_remove(this);
+}
+
+inline void exec_node::self_link()
+{
+ exec_node_self_link(this);
+}
+
+inline void exec_node::insert_after(exec_node *after)
+{
+ exec_node_insert_after(this, after);
+}
+
+inline void exec_node::insert_before(exec_node *before)
+{
+ exec_node_insert_node_before(this, before);
+}
+
+inline void exec_node::replace_with(exec_node *replacement)
+{
+ exec_node_replace_with(this, replacement);
+}
+
+inline bool exec_node::is_tail_sentinel() const
+{
+ return exec_node_is_tail_sentinel(this);
+}
+
+inline bool exec_node::is_head_sentinel() const
+{
+ return exec_node_is_head_sentinel(this);
+}
+#endif