diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-08-27 20:10:37 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-08-27 20:10:37 (GMT) |
commit | 369d17c05c57689338a22988df90bfb8313da071 (patch) | |
tree | a3ad96abed802c0cc203b1fd1de98086aee3d625 /tools | |
parent | 1b95221105760804d2c4776e0a322daa79ee6075 (diff) | |
download | hdf5-369d17c05c57689338a22988df90bfb8313da071.zip hdf5-369d17c05c57689338a22988df90bfb8313da071.tar.gz hdf5-369d17c05c57689338a22988df90bfb8313da071.tar.bz2 |
HDFFV-10876 h5dump OPAQUE size should be optional
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/h5tools_dump.c | 26 | ||||
-rw-r--r-- | tools/src/h5dump/h5dump_ddl.c | 8 | ||||
-rw-r--r-- | tools/testfiles/tudlink-2.ddl | 1 |
3 files changed, 17 insertions, 18 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index a8b7e30..beb397c 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -94,7 +94,7 @@ h5tool_format_t h5tools_dataformat = { const h5tools_dump_header_t h5tools_standardformat = { "standardformat", /*name */ -"HDF5", /*fileebgin */ +"HDF5", /*filebegin */ "", /*fileend */ SUPER_BLOCK, /*bootblockbegin */ "", /*bootblockend */ @@ -2277,18 +2277,26 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; { - char *ttag; + char *ttag; - if(NULL == (ttag = H5Tget_tag(type))) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed") + if(NULL == (ttag = H5Tget_tag(type))) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_tag failed") - ctx->need_prefix = TRUE; + ctx->need_prefix = TRUE; + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + H5free_memory(ttag); - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); - h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + if((size = H5Tget_size(type)) <= 0) { + ctx->need_prefix = TRUE; - H5free_memory(ttag); + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "OPAQUE_SIZE \"%s\";", size); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + } } ctx->indent_level--; diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index e66a1c5..d7c7b1a 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -1943,9 +1943,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT break; case H5L_TYPE_EXTERNAL: - begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); - PRINTVALSTREAM(rawoutstream, "\n"); - indentation(COL); begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin); PRINTVALSTREAM(rawoutstream, "\n"); if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) { @@ -1954,8 +1951,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) { indentation(COL); - PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type); - indentation(COL); PRINTSTREAM(rawoutstream, "TARGETFILE \"%s\"\n", elink_file); indentation(COL); PRINTSTREAM(rawoutstream, "TARGETPATH \"%s\"\n", elink_path); @@ -1979,9 +1974,6 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED * data, int H5_AT begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); PRINTVALSTREAM(rawoutstream, "\n"); indentation(COL); - begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); - PRINTVALSTREAM(rawoutstream, "\n"); - indentation(COL); PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type); end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend); break; diff --git a/tools/testfiles/tudlink-2.ddl b/tools/testfiles/tudlink-2.ddl index 7f4281a..82b9f8e 100644 --- a/tools/testfiles/tudlink-2.ddl +++ b/tools/testfiles/tudlink-2.ddl @@ -1,6 +1,5 @@ HDF5 "tudlink.h5" { USERDEFINED_LINK "udlink2" { - USERDEFINED_LINK "udlink2" { LINKCLASS 187 } } |