diff options
author | Thomas White <taw@bitwiz.org.uk> | 2014-08-20 23:15:39 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2014-08-22 20:32:42 +0200 |
commit | f96a0887eae53fd40633418689b8ddcb054b640d (patch) | |
tree | c3d4abf2a5487f42bb170db3a5929d97e20f549e /src/sc_parse.c | |
parent | 6497ab1b885436c6312aeab0b5e2dd74c6917662 (diff) |
Insert SCBlock for new slide in the right place
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r-- | src/sc_parse.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c index a37775d..0881464 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -170,6 +170,27 @@ SCBlock *sc_block_append_inside(SCBlock *parent, } +/* Insert a new block to the chain, just after "afterme". + * "name", "options" and "contents" will not be copied. Returns the block just + * created, or NULL on error. */ +SCBlock *sc_block_insert_after(SCBlock *afterme, + char *name, char *opt, char *contents) +{ + SCBlock *bl; + + bl = sc_block_new(); + if ( bl == NULL ) return NULL; + + bl->name = name; + bl->options = opt; + bl->contents = contents; + bl->child = NULL; + bl->next = afterme->next; + afterme->next = bl; + + return bl; +} + /* Frees "bl" and all its children */ void sc_block_free(SCBlock *bl) |