summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_dump.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-27 20:10:37 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-27 20:10:37 (GMT)
commit369d17c05c57689338a22988df90bfb8313da071 (patch)
treea3ad96abed802c0cc203b1fd1de98086aee3d625 /tools/lib/h5tools_dump.c
parent1b95221105760804d2c4776e0a322daa79ee6075 (diff)
downloadhdf5-369d17c05c57689338a22988df90bfb8313da071.zip
hdf5-369d17c05c57689338a22988df90bfb8313da071.tar.gz
hdf5-369d17c05c57689338a22988df90bfb8313da071.tar.bz2
HDFFV-10876 h5dump OPAQUE size should be optional
Diffstat (limited to 'tools/lib/h5tools_dump.c')
-rw-r--r--tools/lib/h5tools_dump.c26
1 files changed, 17 insertions, 9 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--;