summaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-04-07 11:46:26 -0700
committerEric Anholt <eric@anholt.net>2010-04-08 11:24:06 -0700
commitcad9766118d269725ef33b4e9588d674d5225010 (patch)
tree41226eeade127594a93b3f4780d9da9dd026b2eb /list.h
parentb427c917ce47675b102fac3ddace883629ff6be8 (diff)
Inline functions consisting of a return of an expression.
Diffstat (limited to 'list.h')
-rw-r--r--list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/list.h b/list.h
index 054be7e..afa32f1 100644
--- a/list.h
+++ b/list.h
@@ -126,6 +126,17 @@ struct exec_node {
this->next->prev = after;
this->next = after;
}
+ /**
+ * Insert a node in the list before the current node
+ */
+ void insert_before(exec_node *before)
+ {
+ before->next = this;
+ before->prev = this->prev;
+
+ this->prev->next = before;
+ this->prev = before;
+ }
#endif
};