diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-03-14 21:05:44 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-03-14 21:05:44 (GMT) |
commit | a518bae9c0120f4e4dd8e72c1c4de17e699e498d (patch) | |
tree | d0061a0198296eb773f837a9e44fe1789f297671 /tools/h5ls | |
parent | 6d8bfb439cbb27b25dcdcb6b4fcffc38837e142e (diff) | |
download | hdf5-a518bae9c0120f4e4dd8e72c1c4de17e699e498d.zip hdf5-a518bae9c0120f4e4dd8e72c1c4de17e699e498d.tar.gz hdf5-a518bae9c0120f4e4dd8e72c1c4de17e699e498d.tar.bz2 |
[svn-r20248] Change name of new VLEN function from H5Tdetect_vlen_str to h5tools_detect_vlen_str to match other functions in tools lib.
Added back test for H5Tdetect_class of H5T_VLEN after each instance of above function to catch all VLEN types in h5dump.
bring back from trunk r20247
Tested: local linux
Diffstat (limited to 'tools/h5ls')
-rw-r--r-- | tools/h5ls/h5ls.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 5671700..d288f4b 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1453,6 +1453,15 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, p_type = h5tools_get_native_type(type); if(p_type >= 0) { + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen_str(p_type) == TRUE) + vl_data = TRUE; + if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + vl_data = TRUE; + temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); assert(temp_need == (hsize_t)((size_t)temp_need)); need = (size_t)temp_need; @@ -1460,6 +1469,11 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, assert(buf); if(H5Aread(attr, p_type, buf) >= 0) h5tools_dump_mem(stdout, &info, attr, p_type, space, buf, -1); + + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + free(buf); H5Tclose(p_type); } /* end if */ |