diff options
author | Thomas White <taw@bitwiz.org.uk> | 2016-11-18 10:56:50 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2016-11-18 10:56:50 +0100 |
commit | a7de2d4816b4ae4727d53f0650d67afbafb01225 (patch) | |
tree | a9fee919eeabfbdba7d3ef076ebe688404e8175f /src/sc_parse.c | |
parent | 03a3f56bebae2902b63c90223a096d01d3224163 (diff) |
Use slide template for new slides
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r-- | src/sc_parse.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c index ed2785a..56b72bf 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -86,6 +86,15 @@ const char *sc_block_contents(const SCBlock *bl) } +void sc_block_append_p(SCBlock *bl, SCBlock *bln) +{ + if ( bl != NULL ) { + bln->next = bl->next; + bl->next = bln; + } +} + + /* Insert a new block after "bl". "name", "options" and "contents" * will not be copied. Returns the block just created, or NULL on error. * If *blfp points to NULL, it will updated to point at the new block. */ @@ -102,10 +111,7 @@ SCBlock *sc_block_append(SCBlock *bl, char *name, char *opt, char *contents, bln->child = NULL; bln->next = NULL; - if ( bl != NULL ) { - bln->next = bl->next; - bl->next = bln; - } + sc_block_append_p(bl, bln); if ( (blfp != NULL) && (*blfp == NULL) ) { *blfp = bln; |