diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2002-11-19 14:50:04 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2002-11-19 14:50:04 (GMT) |
commit | 5f91db8d68d20d8106a58467c73fce15a953807a (patch) | |
tree | cddd7ae4dafcaa1fd26e9cd24322d07e514063d1 /tools | |
parent | 0105a3b97cabccd3463c82c22da7e3f4d23c2b05 (diff) | |
download | hdf5-5f91db8d68d20d8106a58467c73fce15a953807a.zip hdf5-5f91db8d68d20d8106a58467c73fce15a953807a.tar.gz hdf5-5f91db8d68d20d8106a58467c73fce15a953807a.tar.bz2 |
[svn-r6102]
Purpose:
bug fix
Description:
forgot to change datatype print-out when fixed VL string bug for h5dump.
Platforms tested:
modi4
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/h5dump.c | 11 | ||||
-rw-r--r-- | tools/testfiles/tvlstr.h5.xml | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 36250d3..c1abc13 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -3499,7 +3499,8 @@ xml_print_datatype(hid_t type) size_t mpos; size_t msize; int nmembs; - + htri_t is_vlstr=FALSE; + switch (H5Tget_class(type)) { case H5T_INTEGER: indentation(indent); @@ -3593,7 +3594,8 @@ xml_print_datatype(hid_t type) size = H5Tget_size(type); str_pad = H5Tget_strpad(type); cset = H5Tget_cset(type); - + is_vlstr = H5Tis_variable_str(type); + indentation(indent); printf("<AtomicType>\n"); indent += COL; @@ -3604,7 +3606,10 @@ xml_print_datatype(hid_t type) } else { printf("unknown_cset\" "); } - printf("StrSize=\"%d\" StrPad=\"", (int) size); + if(is_vlstr) + printf("StrSize=\"H5T_VARIABLE\" StrPad=\""); + else + printf("StrSize=\"%d\" StrPad=\"", (int) size); if (str_pad == H5T_STR_NULLTERM) { printf("H5T_STR_NULLTERM\"/>\n"); } else if (str_pad == H5T_STR_NULLPAD) { diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml index 3e5b07e..273b23a 100644 --- a/tools/testfiles/tvlstr.h5.xml +++ b/tools/testfiles/tvlstr.h5.xml @@ -11,7 +11,7 @@ Expected output for 'h5dump --xml tvlstr.h5' </Dataspace> <DataType> <AtomicType> - <StringType Cset="H5T_CSET_ASCII" StrSize="4" StrPad="H5T_STR_NULLPAD"/> + <StringType Cset="H5T_CSET_ASCII" StrSize="H5T_VARIABLE" StrPad="H5T_STR_NULLPAD"/> </AtomicType> </DataType> <Data> @@ -23,7 +23,7 @@ Expected output for 'h5dump --xml tvlstr.h5' <NamedDataType Name="vl_string_type" OBJ-XID="/vl_string_type" Parents="root"> <DataType> <AtomicType> - <StringType Cset="H5T_CSET_ASCII" StrSize="16" StrPad="H5T_STR_NULLPAD"/> + <StringType Cset="H5T_CSET_ASCII" StrSize="H5T_VARIABLE" StrPad="H5T_STR_NULLPAD"/> </AtomicType> </DataType> </NamedDataType> @@ -35,7 +35,7 @@ Expected output for 'h5dump --xml tvlstr.h5' </Dataspace> <DataType> <AtomicType> - <StringType Cset="H5T_CSET_ASCII" StrSize="4" StrPad="H5T_STR_NULLTERM"/> + <StringType Cset="H5T_CSET_ASCII" StrSize="H5T_VARIABLE" StrPad="H5T_STR_NULLTERM"/> </AtomicType> </DataType> <Data> |