diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2016-09-19 23:23:30 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2016-09-19 23:23:30 +0200 |
| commit | a05d36f970a5c4723d2be3945076bce9347143ec (patch) | |
| tree | 94f5ca8fc2f479805edbc9252f09f5fbde9026ab /src/block-parser.c | |
| parent | aeefd1959aad3b80a0fe02083edbd5ebfb09510b (diff) | |
| download | cataract-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.c | 20 |
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; + } +} + /* -------------------------------------------------------------------------------------------------------- */ |
