aboutsummaryrefslogtreecommitdiff
path: root/src/sc_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r--src/sc_parse.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index 56b72bf..1018d24 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -211,6 +211,19 @@ static SCBlock *sc_find_parent(SCBlock *top, SCBlock *find)
}
+void sc_block_substitute(SCBlock **top, SCBlock *old, SCBlock *new)
+{
+ if ( old == *top ) {
+ /* It is the first block */
+ new->next = old->next;
+ *top = new;
+ } else {
+ sc_block_delete(*top, old);
+ sc_block_append_p(new, *top);
+ }
+}
+
+
/* Delete "deleteme", which is somewhere under "top" */
void sc_block_delete(SCBlock *top, SCBlock *deleteme)
{