summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1999-08-25 22:01:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1999-08-25 22:01:41 (GMT)
commit9b934aa767e8c177a0ac84cc808dec9ac49135ae (patch)
tree0e8840d231ceab518613dace000a3b9e19c81da8 /src/H5T.c
parenta92c1a7f2cd831a866dd81fe69e0034bfa9338f8 (diff)
downloadhdf5-9b934aa767e8c177a0ac84cc808dec9ac49135ae.zip
hdf5-9b934aa767e8c177a0ac84cc808dec9ac49135ae.tar.gz
hdf5-9b934aa767e8c177a0ac84cc808dec9ac49135ae.tar.bz2
[svn-r1599] Changed return type of H5Tenum_nameof and H5Tenum_valueof from hid_t to herr_t
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 66ed3d1..cfa8187 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1940,9 +1940,12 @@ H5Tset_size(hid_t type_id, size_t size)
if (H5T_STATE_TRANSIENT!=dt->state) {
HRETURN_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
}
- if (size <= 0) {
+ if (size <= 0 && size!=H5T_VARIABLE) {
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive");
}
+ if (size == H5T_VARIABLE && dt->type!=H5T_STRING) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "only strings may be variable length");
+ }
if (H5T_ENUM==dt->type && dt->u.enumer.nmembs>0) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"operation not allowed after members are defined");
@@ -3801,7 +3804,7 @@ H5Tget_member_value(hid_t type, int membno, void *value/*out*/)
*
*-------------------------------------------------------------------------
*/
-hid_t
+herr_t
H5Tenum_nameof(hid_t type, void *value, char *name/*out*/, size_t size)
{
H5T_t *dt = NULL;
@@ -3851,7 +3854,7 @@ H5Tenum_nameof(hid_t type, void *value, char *name/*out*/, size_t size)
*
*-------------------------------------------------------------------------
*/
-hid_t
+herr_t
H5Tenum_valueof(hid_t type, const char *name, void *value/*out*/)
{
H5T_t *dt = NULL;