diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-15 21:54:30 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-15 21:54:30 (GMT) |
commit | 4a17aff4085ad6ee265b95730aca3f493056dec8 (patch) | |
tree | 8bfb665c6d95a2e3520fa1bb0ff54d95aff3923f /src/H5Tenum.c | |
parent | 853ae26333592faf69cd8c454ef92ffea8549df5 (diff) | |
download | hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.zip hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.gz hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.bz2 |
Add API context interface and use it throughout the library.
Diffstat (limited to 'src/H5Tenum.c')
-rw-r--r-- | src/H5Tenum.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/H5Tenum.c b/src/H5Tenum.c index f5263ed..ade7d08 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -57,23 +57,24 @@ H5Tenum_create(hid_t parent_id) H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", parent_id); /* Check args */ if(NULL == (parent = (H5T_t *)H5I_object_verify(parent_id, H5I_DATATYPE)) || H5T_INTEGER != parent->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an integer data type") /* Build new type */ if(NULL == (dt = H5T__enum_create(parent))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type") + /* Atomize the type */ if ((ret_value=H5I_register(H5I_DATATYPE, dt, TRUE))<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type atom") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Tenum_create() */ /*------------------------------------------------------------------------- @@ -446,7 +447,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close data type"); if(!ret_value && alloc_name) H5MM_free(name); @@ -574,7 +575,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close data type") FUNC_LEAVE_NOAPI(ret_value) |