summaryrefslogtreecommitdiffstats
path: root/tools/h5ls/h5ls.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-14 16:29:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-14 16:29:10 (GMT)
commit0894356a3c6e17b00c7911d8199b64eefca7aa3a (patch)
tree9e9ab954ab103b64aa6ba87da4fbe30127f4035f /tools/h5ls/h5ls.c
parente0bb475838f0c31743018e5c1c770b30b9373440 (diff)
downloadhdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.zip
hdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.tar.gz
hdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.tar.bz2
[svn-r16311] Description:
Bring revisions 16280:16307 back from trunk. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/h5ls/h5ls.c')
-rw-r--r--tools/h5ls/h5ls.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index eec1fcd..d0af4bb 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1515,7 +1515,8 @@ dataset_list2(hid_t dset, const char UNUSED *name)
int ndims; /* dimensionality */
int n, max_len; /* max extern file name length */
double utilization; /* percent utilization of storage */
- int i;
+ H5T_class_t tclass; /* datatype class identifier */
+ int i;
if(verbose_g > 0) {
dcpl = H5Dget_create_plist(dset);
@@ -1539,14 +1540,35 @@ dataset_list2(hid_t dset, const char UNUSED *name)
/* Print total raw storage size */
total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type);
used = H5Dget_storage_size(dset);
+ tclass = H5Tget_class(type);
printf(" %-10s ", "Storage:");
- printf("%lu logical byte%s, %lu allocated byte%s",
- (unsigned long)total, 1==total?"":"s",
- (unsigned long)used, 1==used?"":"s");
- if (used>0) {
- utilization = (total*100.0)/used;
- printf(", %1.2f%% utilization", utilization);
+ switch (tclass)
+ {
+
+ case H5T_VLEN:
+ printf("information not available");
+ break;
+
+ case H5T_REFERENCE:
+ if ( H5Tequal(type, H5T_STD_REF_DSETREG))
+ {
+ printf("information not available");
+ }
+ break;
+
+ default:
+ printf("%lu logical byte%s, %lu allocated byte%s",
+ (unsigned long)total, 1==total?"":"s",
+ (unsigned long)used, 1==used?"":"s");
+ if (used>0)
+ {
+ utilization = (total*100.0)/used;
+ printf(", %1.2f%% utilization", utilization);
+ }
+
}
+
+
putchar('\n');
/* Print information about external strorage */