summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 42c6714..69cf02b 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1752,7 +1752,7 @@ H5Tget_class(hid_t type_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type");
/* Set return value */
- ret_value= H5T_get_class(dt);
+ ret_value= H5T_get_class(dt, FALSE);
done:
FUNC_LEAVE_API(ret_value);
@@ -1778,7 +1778,7 @@ done:
*-------------------------------------------------------------------------
*/
H5T_class_t
-H5T_get_class(const H5T_t *dt)
+H5T_get_class(const H5T_t *dt, htri_t internal)
{
H5T_class_t ret_value;
@@ -1792,6 +1792,16 @@ H5T_get_class(const H5T_t *dt)
else
ret_value=dt->shared->type;
+ /* Externally, a VL string is a string; internally, a VL string is a VL. */
+ if(internal) {
+ ret_value=dt->shared->type;
+ } else {
+ if(H5T_IS_VL_STRING(dt->shared))
+ ret_value=H5T_STRING;
+ else
+ ret_value=dt->shared->type;
+ }
+
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5T_get_class() */
@@ -1827,8 +1837,12 @@ H5Tdetect_class(hid_t type, H5T_class_t cls)
if (!(cls>H5T_NO_CLASS && cls<H5T_NCLASSES))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type class");
- /* Set return value */
- ret_value=H5T_detect_class(dt,cls);
+ /* Set return value. Consider VL string as a string for API, as a VL for
+ * internal use. */
+ if(H5T_IS_VL_STRING(dt->shared))
+ ret_value = (H5T_STRING==cls);
+ else
+ ret_value=H5T_detect_class(dt,cls);
done:
FUNC_LEAVE_API(ret_value);