summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-07-10 20:18:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-07-10 20:18:52 (GMT)
commit0c1c23245d103927c5d59c67b84526974e6217af (patch)
treeeeaa0829d0ba6a98a91f5c1e224f91a049b54d99 /tools/h5dump/h5dump.c
parentd7bb1d0c0752461dc0e4316c85c72867490b8532 (diff)
downloadhdf5-0c1c23245d103927c5d59c67b84526974e6217af.zip
hdf5-0c1c23245d103927c5d59c67b84526974e6217af.tar.gz
hdf5-0c1c23245d103927c5d59c67b84526974e6217af.tar.bz2
[svn-r4180] Purpose:
Documentation Description: Accommodate v1.2.x behavior when --enable-hdf5v1_2 is enabled. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 85c554b..977d67c 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -861,6 +861,28 @@ print_datatype(hid_t type)
for (i = 0; i < nmembers; i++) {
fname = H5Tget_member_name(type, i);
mtype = H5Tget_member_type(type, i);
+#ifdef WANT_H5_V1_2_COMPAT
+ /* v1.2 returns the base type of an array field, work around this */
+ {
+ hid_t new_mtype; /* datatype for array, if necessary */
+ int arrndims; /* Array rank for reading */
+ size_t dims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ hsize_t arrdims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ int k; /* Local index variable */
+
+ /* Get the array dimensions */
+ arrndims=H5Tget_member_dims(type,i,dims,NULL);
+
+ /* Patch up array information */
+ if(arrndims>0) {
+ for(k=0; k<arrndims; k++)
+ arrdims[k]=dims[k];
+ new_mtype=H5Tarray_create(mtype,arrndims,arrdims,NULL);
+ H5Tclose(mtype);
+ mtype=new_mtype;
+ } /* end if */
+ }
+#endif /* WANT_H5_V1_2_COMPAT */
indentation(indent + COL);
@@ -3622,6 +3644,28 @@ xml_print_datatype(hid_t type)
fname = H5Tget_member_name(type, i);
mtype = H5Tget_member_type(type, i);
+#ifdef WANT_H5_V1_2_COMPAT
+ /* v1.2 returns the base type of an array field, work around this */
+ {
+ hid_t new_mtype; /* datatype for array, if necessary */
+ int arrndims; /* Array rank for reading */
+ size_t dims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ hsize_t arrdims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ int k; /* Local index variable */
+
+ /* Get the array dimensions */
+ arrndims=H5Tget_member_dims(type,i,dims,NULL);
+
+ /* Patch up array information */
+ if(arrndims>0) {
+ for(k=0; k<arrndims; k++)
+ arrdims[k]=dims[k];
+ new_mtype=H5Tarray_create(mtype,arrndims,arrdims,NULL);
+ H5Tclose(mtype);
+ mtype=new_mtype;
+ } /* end if */
+ }
+#endif /* WANT_H5_V1_2_COMPAT */
indentation(indent);
t_fname = xml_escape_the_name(fname);
printf("<Field FieldName=\"%s\">\n", t_fname);
@@ -4179,6 +4223,28 @@ xml_dump_named_datatype(hid_t type, const char *name)
fname = H5Tget_member_name(type, x);
mtype = H5Tget_member_type(type, x);
+#ifdef WANT_H5_V1_2_COMPAT
+ /* v1.2 returns the base type of an array field, work around this */
+ {
+ hid_t new_mtype; /* datatype for array, if necessary */
+ int arrndims; /* Array rank for reading */
+ size_t dims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ hsize_t arrdims[H5S_MAX_RANK]; /* Array dimensions for reading */
+ int k; /* Local index variable */
+
+ /* Get the array dimensions */
+ arrndims=H5Tget_member_dims(type,x,dims,NULL);
+
+ /* Patch up array information */
+ if(arrndims>0) {
+ for(k=0; k<arrndims; k++)
+ arrdims[k]=dims[k];
+ new_mtype=H5Tarray_create(mtype,arrndims,arrdims,NULL);
+ H5Tclose(mtype);
+ mtype=new_mtype;
+ } /* end if */
+ }
+#endif /* WANT_H5_V1_2_COMPAT */
indentation(indent);
t_fname = xml_escape_the_name(fname);
printf("<Field FieldName=\"%s\">\n", t_fname);