From eb3092f8bd30d065c4e6f4bf0159309e1a960156 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 31 Mar 2011 23:23:24 +0200 Subject: block-parser: Add function to mark block as used Some blocks such as "IMG_LIST" are containers themselves and no data are retrieved from them. That way they don't ever get marked as used, resulting in constant hit in the generator loop. --- src/block-parser.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/block-parser.c') 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; + } +} -- cgit v1.2.3