summaryrefslogtreecommitdiff
path: root/src/block-parser.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2016-09-19 23:23:30 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2016-09-19 23:23:30 +0200
commita05d36f970a5c4723d2be3945076bce9347143ec (patch)
tree94f5ca8fc2f479805edbc9252f09f5fbde9026ab /src/block-parser.c
parentaeefd1959aad3b80a0fe02083edbd5ebfb09510b (diff)
downloadcataract-a05d36f970a5c4723d2be3945076bce9347143ec.tar.xz
block-parser: Clear processed data for further use
This change will allow certain blocks to be present multiple times and processed independently within a single page.
Diffstat (limited to 'src/block-parser.c')
-rw-r--r--src/block-parser.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/block-parser.c b/src/block-parser.c
index 48c7671..f4ed78b 100644
--- a/src/block-parser.c
+++ b/src/block-parser.c
@@ -220,6 +220,26 @@ block_parser_set_as_used (BlockParser *parser, const gchar *key)
}
}
+/*
+ * block_parser_clear_key_data: clear stored data block for the key
+ *
+ */
+void
+block_parser_clear_key_data (BlockParser *parser, const gchar *key)
+{
+ BlockData *data = NULL;
+
+ g_assert (parser != NULL);
+
+ data = g_hash_table_lookup (parser->table, key);
+ if (data != NULL) {
+ g_free (data->data);
+ data->data = NULL;
+ data->used = FALSE;
+ data->finished = FALSE;
+ }
+}
+
/* -------------------------------------------------------------------------------------------------------- */