From 378df38955700bffd90303965e1685341e785b1d Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Thu, 31 Jan 2002 14:47:06 -0500 Subject: [svn-r4892] ./hdf5-devel/tools/h5ls/h5ls.c 2002-01-31 15:22:24 Robb Matzke *: Displays array data type information instead of saying `4-byte class-10 unknown'. --- tools/h5ls/h5ls.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index bfbe251..df9b0b5 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1056,6 +1056,64 @@ display_vlen_type(hid_t type, int ind) return TRUE; } +/*--------------------------------------------------------------------------- + * Purpose: Print information about an array type + * + * Return: Success: TRUE + * + * Failure: FALSE + * + * Programmer: Robb Matzke + * Thursday, January 31, 2002 + * + * Modifications: + *--------------------------------------------------------------------------- + */ +static hbool_t +display_array_type(hid_t type, int ind) +{ + hid_t super; + int ndims, i, *perm=NULL, identity; + hsize_t *dims=NULL; + + if (H5T_ARRAY!=H5Tget_class(type)) return FALSE; + ndims = H5Tget_array_ndims(type); + if (ndims) { + dims = malloc(ndims*sizeof(dims[0])); + perm = malloc(ndims*sizeof(perm[0])); + H5Tget_array_dims(type, dims, perm); + + /* Print dimensions */ + for (i=0; i