summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-12-10 16:10:22 (GMT)
committerPatrick Lu <ptlu@hawkwind.ncsa.uiuc.edu>1999-12-10 16:10:22 (GMT)
commit29a4de77860bf4297d43290e95ea19f83ad59650 (patch)
tree57f787908b04724e7201fd3ccf3c50477da9fd33 /tools
parent20f2faee42d58f5801710b3cbf9bf572f54a052d (diff)
downloadhdf5-29a4de77860bf4297d43290e95ea19f83ad59650.zip
hdf5-29a4de77860bf4297d43290e95ea19f83ad59650.tar.gz
hdf5-29a4de77860bf4297d43290e95ea19f83ad59650.tar.bz2
[svn-r1866] getting rid of the changes i just made.
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index 414d0bf..8ae0340 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -771,12 +771,44 @@ 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();
}