summaryrefslogtreecommitdiffstats
path: root/tools/h5dump.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-12-11 21:26:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-12-11 21:26:26 (GMT)
commit5c5b65eeec0d52f82007acfdc44eee39412adfcf (patch)
tree56baf888d1d0b66125f58528dea53605fc0f4ea3 /tools/h5dump.c
parent6cfbe1f0c7e2edef351ff69e57de8cdd603de57d (diff)
downloadhdf5-5c5b65eeec0d52f82007acfdc44eee39412adfcf.zip
hdf5-5c5b65eeec0d52f82007acfdc44eee39412adfcf.tar.gz
hdf5-5c5b65eeec0d52f82007acfdc44eee39412adfcf.tar.bz2
[svn-r3112] Purpose:
Bug Fix Description: Stumbled across a problem when working on the J90 h5dump problem where I noticed that some of the output for named compound datatypes wasn't being displayed. Solution: Corrected output to display missing information. Platforms tested: FreeBSD 4.2 (hawkwind) & Cray J90 (killeen)
Diffstat (limited to 'tools/h5dump.c')
-rw-r--r--tools/h5dump.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index c45f8a9..f984102 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -462,14 +462,13 @@ print_datatype(hid_t type)
if (H5Tcommitted(type) > 0) {
H5Gget_objinfo(type, ".", TRUE, &statbuf);
i = search_obj (type_table, statbuf.objno);
- indentation(indent + COL);
if (i >= 0) {
if (!type_table->objs[i].recorded)
printf("\"/#%lu:%lu\"\n", type_table->objs[i].objno[0],
type_table->objs[i].objno[1]);
else
- printf("\"%s\"\n", type_table->objs[i].objname);
+ printf("\"%s\"", type_table->objs[i].objname);
} else {
printf("h5dump error: unknown committed type.\n");
d_status = 1;
@@ -1020,27 +1019,15 @@ done:
static void
dump_named_datatype(hid_t type, const char *name)
{
- int nmembers = 1, x;
- hid_t comptype;
- char *compname;
-
indentation(indent);
- begin_obj(dump_header_format->datatypebegin, name,
+ printf("%s \"%s\" %s",dump_header_format->datatypebegin, name,
dump_header_format->datatypeblockbegin);
if (H5Tget_class(type) == H5T_COMPOUND) {
- nmembers = H5Tget_nmembers(type);
-
- for (x = 0; x < nmembers; x++) {
- comptype = H5Tget_member_type(type,x);
- compname = H5Tget_member_name(type,x);
+ hid_t temp_type=H5Tcopy(type);
- indentation(indent + COL);
- print_datatype(comptype);
- printf(" \"%s\"", compname);
-
- printf(";\n");
- }
+ print_datatype(temp_type);
+ H5Tclose(temp_type);
} else {
indentation(indent + COL);
print_datatype(type);