summaryrefslogtreecommitdiffstats
path: root/tools/h5dump.c
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-12-17 16:56:10 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-12-17 16:56:10 (GMT)
commitbb92bb97126ac57c0137e4189f84d68f5e57cd9e (patch)
tree5839fa58cada234edaf5869b7a852b0078cfc2f7 /tools/h5dump.c
parent4d18fe3563cdf5a88e8cfe5514c4a0e2eb215f4d (diff)
downloadhdf5-bb92bb97126ac57c0137e4189f84d68f5e57cd9e.zip
hdf5-bb92bb97126ac57c0137e4189f84d68f5e57cd9e.tar.gz
hdf5-bb92bb97126ac57c0137e4189f84d68f5e57cd9e.tar.bz2
[svn-r1898] backed out the changes that were breaking the test cases until i can
figure a way to fix the problem. decided to back it out since i will be leaving for christmas in a few days and won't be back until jan.
Diffstat (limited to 'tools/h5dump.c')
-rw-r--r--tools/h5dump.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index b80ecb8..29fe857 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -775,15 +775,48 @@ done:
*-----------------------------------------------------------------------*/
static void
dump_named_datatype (hid_t type, const char *name) {
+char *fname ;
+hid_t nmembers, mtype;
+int i, j, ndims, perm[H5DUMP_MAX_RANK];
+size_t dims[H5DUMP_MAX_RANK];
indentation (indent);
begin_obj(DATATYPE, name);
- indentation (indent+COL);
- print_datatype(type);
- printf("\n");
+
+ nmembers = H5Tget_nmembers(type);
+
+ for (i = 0; i < nmembers; i++) {
+
+ fname = H5Tget_member_name(type, i);
+
+ mtype = H5Tget_member_type(type, i);
+
+ ndims = H5Tget_member_dims(type, i, dims, perm);
+
+ indentation (indent+COL);
+ if (H5T_ENUM == H5Tget_class(type)) {
+ print_datatype(type);
+ break;
+ }
+ else {
+ print_datatype(mtype);
+ }
+ printf (" \"%s\"", fname);
+
+ if (ndims != 1 || dims[0] != 1) {
+ for (j = 0; j < ndims; j++)
+ printf("[%d]",dims[j]);
+ }
+
+ printf (";\n");
+
+ free (fname);
+ }
+
indentation (indent);
end_obj();
}
+
/*-------------------------------------------------------------------------
* Function: dump_group