summaryrefslogtreecommitdiff
path: root/src/block-parser.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2011-03-31 23:23:24 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2011-03-31 23:23:24 +0200
commiteb3092f8bd30d065c4e6f4bf0159309e1a960156 (patch)
treeb17974a38900afde77e67c91c96523e2b2ef0d7e /src/block-parser.c
parent6707d9314ceedb12bfd995b924af4de6b9110800 (diff)
downloadcataract-eb3092f8bd30d065c4e6f4bf0159309e1a960156.tar.xz
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.
Diffstat (limited to 'src/block-parser.c')
-rw-r--r--src/block-parser.c17
1 files changed, 17 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;
+ }
+}