diff options
Diffstat (limited to 'src/H5Gdeprec.c')
-rw-r--r-- | src/H5Gdeprec.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 9f8a39f..fc74bcf 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -151,20 +151,28 @@ done: /*------------------------------------------------------------------------- * Function: H5Gunlink * - * Purpose: Removes a link. The new API is H5Lunlink. + * Purpose: Removes a link. The new API is H5Ldelete. * *------------------------------------------------------------------------- */ herr_t H5Gunlink(hid_t loc_id, const char *name) { - herr_t ret_value; + H5G_loc_t loc; /* Group's location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Gunlink, FAIL) H5TRACE2("e","is",loc_id,name); - if((ret_value = H5Lunlink(loc_id, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "Couldn't delete link") + /* Check arguments */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + + /* Call H5L routine... */ + if(H5L_delete(&loc, name, H5P_DEFAULT, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "couldn't delete link") done: FUNC_LEAVE_API(ret_value) @@ -182,8 +190,8 @@ done: herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { - H5G_loc_t loc; - herr_t ret_value = SUCCEED; + H5G_loc_t loc; /* Group's location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Gget_linkval, FAIL) H5TRACE4("e","iszx",loc_id,name,size,buf); @@ -195,7 +203,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Call the new link routine which provides this capability */ - if(H5L_get_val(&loc, name, size, buf, H5P_DEFAULT, H5P_DEFAULT) < 0) + if(H5L_get_val(&loc, name, size, buf, H5P_DEFAULT, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") done: |