From 093800152300ea577ee744bcede5b65c4882f651 Mon Sep 17 00:00:00 2001 From: Petr Tesarik Date: Tue, 23 Oct 2012 00:25:16 +0200 Subject: [PATCH] Report BAD and EOF flags in dump_blocks() Useful for debugging (and not compiled in otherwise). --- libhed/file.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libhed/file.c b/libhed/file.c index 95f1522..bcf2aea 100644 --- a/libhed/file.c +++ b/libhed/file.c @@ -228,11 +228,10 @@ block_phys_size(struct hed_block *block) } static void -dump_block(int level, struct hed_file *file, struct hed_tree_node *node, +dump_block(int level, struct file_priv *file, struct hed_tree_node *node, hed_uoff_t *cur_offset, hed_uoff_t *cur_poffset) { struct hed_block *block = tree_entry(node, struct hed_block, t); - bool virtual = hed_block_is_virtual(block); unsigned char *p; hed_cursor_t *cur; char t[21] = " "; @@ -241,12 +240,14 @@ dump_block(int level, struct hed_file *file, struct hed_tree_node *node, dump_block(level + 1, file, node->left, cur_offset, cur_poffset); p = hed_block_data(block); if (level < 20) t[level] = '>'; else t[19] = '.'; - fprintf(stderr, "%s [%06llx] [%06llx] %c%c%c %05llx %05llx" + fprintf(stderr, "%s [%06llx] [%06llx] %c%c%c%c%c %05llx %05llx" " {%02x%02x%02x%02x} -- %p ^%p [%06llx]\n", t, (unsigned long long) *cur_offset, (unsigned long long) *cur_poffset, - virtual ? 'v' : ' ', + hed_block_is_bad(block) ? 'b' : ' ', + hed_block_is_eof(block) ? 'e' : ' ', + hed_block_is_virtual(block) ? 'v' : ' ', hed_block_is_inserted(block) ? 'i' : ' ', hed_block_is_dirty(block) ? '*' : ' ', (unsigned long long) node->size, -- 2.11.4.GIT