diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/block-parser.c | 17 | ||||
| -rw-r--r-- | src/block-parser.h | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/block-parser.c b/src/block-parser.c index d4a04c1..d4fcccb 100644 --- a/src/block-parser.c +++ b/src/block-parser.c @@ -147,6 +147,23 @@ block_parser_has_unused_data (BlockParser *parser, const gchar *key) return FALSE; } +/* + * block_parser_set_as_used: manually set data as used - sometimes blocks can act as containers for other nested blocks and + * cannot be used itself + * + */ +void +block_parser_set_as_used (BlockParser *parser, const gchar *key) +{ + BlockData *data = NULL; + + g_assert (parser != NULL); + + data = g_hash_table_lookup (parser->table, key); + if (data != NULL && data->finished == TRUE) { + data->used = TRUE; + } +} diff --git a/src/block-parser.h b/src/block-parser.h index 666d27a..21d0cfb 100644 --- a/src/block-parser.h +++ b/src/block-parser.h @@ -56,6 +56,13 @@ gchar * block_parser_get_data (BlockParser *parser, const gchar *key); gboolean block_parser_has_unused_data (BlockParser *parser, const gchar *key); /* + * block_parser_set_as_used: manually set data as used - sometimes blocks can act as containers for other nested blocks and + * cannot be used itself + * + */ +void block_parser_set_as_used (BlockParser *parser, const gchar *key); + +/* * block_parser_read_and_parse: reads input from the file and returns parsed line * - if there's a multiline block, string before the opening placeholder and * string after closing placeholder are returned on one line, |
