diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-01-10 16:24:27 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-01-10 16:24:27 (GMT) |
commit | 2a30e511b9c4f8dbcc5ab82765887f63c9b1184e (patch) | |
tree | ef7a2395a605109aab04f0f6c5ce69e3f1725290 /tools/lib/h5tools_str.c | |
parent | 50926c2ae9752c69f84d2a2e7503df7bc1ab71b9 (diff) | |
download | hdf5-2a30e511b9c4f8dbcc5ab82765887f63c9b1184e.zip hdf5-2a30e511b9c4f8dbcc5ab82765887f63c9b1184e.tar.gz hdf5-2a30e511b9c4f8dbcc5ab82765887f63c9b1184e.tar.bz2 |
[svn-r13132]
Fixed #720 h5dump: improve how region references are displayed. h5dump now uses the new API function H5Rget_name to display the name of the dataset referenced instead of its ID. Added a case to the script test file
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r-- | tools/lib/h5tools_str.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index a1cfc83..3fe629c 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -844,17 +844,15 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (h5tools_is_zero(vp, H5Tget_size(type))) { h5tools_str_append(str, "NULL"); } else { - haddr_t objno; /* Compact form of object's location */ + char name[1024]; obj = H5Rdereference(container, H5R_DATASET_REGION, vp); region = H5Rget_region(container, H5R_DATASET_REGION, vp); H5Gget_objinfo(obj, ".", FALSE, &sb); - - objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long))); - if (info->dset_hidefileno) - h5tools_str_append(str, info->dset_format, objno); - else - h5tools_str_append(str, info->dset_format, sb.fileno[0], objno); + + /* get name of the dataset the region reference points to using H5Rget_name */ + H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*)name, 1024); + h5tools_str_append(str, info->dset_format, name); h5tools_str_dump_region(str, region, info); H5Sclose(region); |