summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-02-17 18:35:30 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>2000-02-17 18:35:30 (GMT)
commit6a2bc2f4aa425e8e515cd348f0d4e81d4992ae1e (patch)
treeeaf5cbb8fddf298a55cf87839bbd51e3d8e4b07b
parent82cd7cca30d82e5b68ff8e9d2e10335d89ad9884 (diff)
downloadhdf5-6a2bc2f4aa425e8e515cd348f0d4e81d4992ae1e.zip
hdf5-6a2bc2f4aa425e8e515cd348f0d4e81d4992ae1e.tar.gz
hdf5-6a2bc2f4aa425e8e515cd348f0d4e81d4992ae1e.tar.bz2
[svn-r1973] fixed the dataset regions problem with the dumper.
now the dump structure contains 2 extra members that tell how to format the data for the dataset regions(blocks and pts). had to give h5ls values for these
-rw-r--r--tools/h5dump.c7
-rw-r--r--tools/h5ls.c11
-rw-r--r--tools/h5tools.c20
-rw-r--r--tools/h5tools.h8
4 files changed, 39 insertions, 7 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index f493e69..d3f5699 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -1096,6 +1096,13 @@ dump_data (hid_t obj_id, int obj_data) {
info.obj_hidefileno = 1;
info.obj_format = " %lu:%lu";
+
+ info.dset_hidefileno = 1;
+ info.dset_format = "DATASET %lu:%lu ";
+ info.dset_blockformat_pre = "%s";
+ info.dset_ptformat_pre = "%s";
+
+
indent += COL;
/*the depth will tell us how far we need to indent extra. we use to just
use indent but with the merging of the tools lib we have to do something different
diff --git a/tools/h5ls.c b/tools/h5ls.c
index 8c1963f..b5b4dfe 100644
--- a/tools/h5ls.c
+++ b/tools/h5ls.c
@@ -1131,6 +1131,17 @@ dump_dataset_values(hid_t dset)
info.cmpd_pre = "";
info.cmpd_suf = "";
info.cmpd_sep = " ";
+
+ info.dset_format = "DSET-%lu:%lu:%lu:%lu-";
+ info.dset_hidefileno = 0;
+
+ info.obj_format = "-%lu:%lu:%lu:%lu";
+ info.obj_hidefileno = 0;
+
+ info.dset_blockformat_pre = "%sBlk%lu: ";
+ info.dset_ptformat_pre = "%sPt%lu: ";
+
+
if (label_g) info.cmpd_name = "%s=";
info.elmt_suf1 = " ";
diff --git a/tools/h5tools.c b/tools/h5tools.c
index f26ea34..f3d55ce6 100644
--- a/tools/h5tools.c
+++ b/tools/h5tools.c
@@ -507,7 +507,7 @@ h5dump_is_zero(const void *_mem, size_t size)
*-------------------------------------------------------------------------
*/
static int
-h5dump_region(hid_t region, h5dump_str_t *str/*in,out*/)
+h5dump_region(hid_t region, h5dump_str_t *str/*in,out*/, h5dump_t *info)
{
hssize_t nblocks, npoints, i;
hsize_t *ptdata;
@@ -531,7 +531,7 @@ h5dump_region(hid_t region, h5dump_str_t *str/*in,out*/)
H5Sget_select_hyper_blocklist(region, 0, nblocks, ptdata);
for (i=0; i<nblocks; i++) {
- h5dump_str_append(str, "%sBlk%lu: ",
+ h5dump_str_append(str, info->dset_blockformat_pre,
i?","OPTIONAL_LINE_BREAK" ":"",
(unsigned long)i);
@@ -555,7 +555,7 @@ h5dump_region(hid_t region, h5dump_str_t *str/*in,out*/)
H5Sget_select_elem_pointlist(region, 0, npoints, ptdata);
for (i=0; i<npoints; i++) {
- h5dump_str_append(str, "%sPt%lu: ",
+ h5dump_str_append(str, info->dset_ptformat_pre ,
i?","OPTIONAL_LINE_BREAK" ":"",
(unsigned long)i);
@@ -933,10 +933,16 @@ h5dump_sprint(h5dump_str_t *str/*in,out*/, const h5dump_t *info,
obj = H5Rdereference(container, H5R_DATASET_REGION, vp);
region = H5Rget_region(container, H5R_DATASET_REGION, vp);
H5Gget_objinfo(obj, ".", FALSE, &sb);
- h5dump_str_append(str, "DSET-%lu:%lu:%lu:%lu-",
- sb.fileno[1], sb.fileno[0],
- sb.objno[1], sb.objno[0]);
- h5dump_region(region, str);
+ if (info->dset_hidefileno){
+ h5dump_str_append(str, info->dset_format,
+ sb.objno[1], sb.objno[0]);
+ }
+ else {
+ h5dump_str_append(str, info->dset_format,
+ sb.fileno[1], sb.fileno[0],
+ sb.objno[1], sb.objno[0]);
+ }
+ h5dump_region(region, str, info);
H5Sclose(region);
H5Dclose(obj);
}
diff --git a/tools/h5tools.h b/tools/h5tools.h
index eb92dab..bb145ec 100644
--- a/tools/h5tools.h
+++ b/tools/h5tools.h
@@ -265,6 +265,14 @@ typedef struct h5dump_t {
int obj_hidefileno; /*flag used to hide or show the file number for obj refs*/
const char *obj_format; /*string used to format the output for the obje refs*/
+ int dset_hidefileno;/*flag used to hide or show the file number for dataset regions*/
+ const char *dset_format; /*string used to format the output for the dataset regions*/
+
+ const char *dset_blockformat_pre;
+ const char *dset_ptformat_pre;
+ const char *dset_ptformat;
+
+
} h5dump_t;