aboutsummaryrefslogtreecommitdiff
path: root/src/sc_parse.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-01-13 22:18:32 +0100
committerThomas White <taw@bitwiz.org.uk>2014-01-13 22:18:32 +0100
commitcc3e2244796a54a394d534e19149bc53fe2b3b71 (patch)
tree8ab75dd9b2ef525432dd3a2be2154bde26135980 /src/sc_parse.c
parent0f030d0268fc72d6a52ea221e876ff0386ebb226 (diff)
Debugging improvements
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r--src/sc_parse.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index 328e397..b94f548 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -135,22 +135,25 @@ void sc_block_free(SCBlock *bl)
static void recursive_show_sc_blocks(const char *prefix, const SCBlock *bl)
{
while ( bl != NULL ) {
+ show_sc_block(bl, prefix);
+ bl = bl->next;
+ }
+}
- printf("%s", prefix);
- if ( bl->name != NULL ) printf("\\%s ", bl->name);
- if ( bl->options != NULL ) printf("[%s] ", bl->options);
- if ( bl->contents != NULL ) printf("{%s}", bl->contents);
- printf("\n");
-
- if ( bl->child != NULL ) {
- char new_prefix[strlen(prefix)+3];
- strcpy(new_prefix, " ");
- strcat(new_prefix, prefix);
- recursive_show_sc_blocks(new_prefix, bl->child);
- }
- bl = bl->next;
+void show_sc_block(const SCBlock *bl, const char *prefix)
+{
+ printf("%s", prefix);
+ if ( bl->name != NULL ) printf("\\%s ", bl->name);
+ if ( bl->options != NULL ) printf("[%s] ", bl->options);
+ if ( bl->contents != NULL ) printf("{%s}", bl->contents);
+ printf("\n");
+ if ( bl->child != NULL ) {
+ char new_prefix[strlen(prefix)+3];
+ strcpy(new_prefix, " ");
+ strcat(new_prefix, prefix);
+ recursive_show_sc_blocks(new_prefix, bl->child);
}
}