summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/h5dump/h5dump.c11
-rw-r--r--tools/testfiles/tvlstr.h5.xml6
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>