diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-04-13 20:15:00 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-04-13 20:15:00 (GMT) |
commit | 26e709edc65f279cb4a9fbd4e31a9531ce62a8b7 (patch) | |
tree | 14da10a605fa991fe6632d4e871dd661b7c2416f /tools | |
parent | 6a27582a4488d4d18a0b6cd584b8950ab02b81a7 (diff) | |
download | hdf5-26e709edc65f279cb4a9fbd4e31a9531ce62a8b7.zip hdf5-26e709edc65f279cb4a9fbd4e31a9531ce62a8b7.tar.gz hdf5-26e709edc65f279cb4a9fbd4e31a9531ce62a8b7.tar.bz2 |
[svn-r26794] Fix formatting for selection. Irregular reuses blocks and points for datasets however indentation after line breaks are an issue.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5tools_dump.c | 34 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 9 |
2 files changed, 20 insertions, 23 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 29a6d68..54b7015 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2890,15 +2890,33 @@ h5tools_print_virtual_selection(hid_t vspace, hid_t dcpl_id, size_t index, h5tools_str_append(buffer, " %s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_HYPERSLABS: /* "New-style" hyperslab selection defined */ + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + h5tools_str_reset(buffer); if (H5Sis_regular_hyperslab(vspace)) { h5tools_str_append(buffer, "%s %s ", VDS_REG_HYPERSLAB, h5tools_dump_header_format->virtualselectionblockbegin); + h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + + h5tools_str_reset(buffer); h5tools_str_dump_space_slabs(buffer, vspace, info, ctx); } else { h5tools_str_append(buffer, "%s %s ", VDS_IRR_HYPERSLAB, h5tools_dump_header_format->virtualselectionblockbegin); + h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + ctx->indent_level++; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(buffer); h5tools_str_dump_space_blocks(buffer, vspace, info); + ctx->indent_level--; } + h5tools_render_element(stream, info, ctx, buffer, curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s", h5tools_dump_header_format->virtualselectionblockend); break; case H5S_SEL_ALL: /* Entire extent selected */ @@ -3001,11 +3019,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level++; - - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - stl = H5Pget_layout(dcpl_id); switch (stl) { case H5D_CHUNKED: @@ -3243,21 +3256,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); -/*EIP h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "%s", END); -*/ h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); } ctx->indent_level--; } - - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); } break; default: @@ -3266,8 +3270,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); }/*switch*/ - ctx->indent_level--; - ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 4381df8..cd1bec8 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -438,11 +438,9 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, H5Sget_regular_hyperslab(rspace, start, stride, count, block); /* Print hyperslab information */ - h5tools_str_append(str, "%s", "\n"); - h5tools_str_indent(str, info, ctx); /* Start coordinates */ - h5tools_str_append(str, "%s ", START); + h5tools_str_append(str, "%s%s ", info->line_indent, START); for (j = 0; j < ndims; j++) h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", start[j]); h5tools_str_append(str, ")"); @@ -478,8 +476,6 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", block[j]); } h5tools_str_append(str, ")"); - h5tools_str_append(str, "%s", "\n"); - h5tools_str_indent(str, info, ctx); } /*------------------------------------------------------------------------- @@ -523,8 +519,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, for (i = 0; i < nblocks; i++) { int j; - h5tools_str_append(str, info->dset_blockformat_pre, i ? "," OPTIONAL_LINE_BREAK " " : "", - (unsigned long)i); + h5tools_str_append(str, info->dset_blockformat_pre, i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)i); /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) |