summaryrefslogtreecommitdiffstats
path: root/src/H5Glink.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-09-25 22:18:33 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-09-25 22:18:33 (GMT)
commit68c01f91d94d1fa7a7cff198cb8daf6c89f05da7 (patch)
tree8035fe4ed2f2a10855575c91969e4107af382d46 /src/H5Glink.c
parent02296972ec8a90ad50d89786755d0e953e95b455 (diff)
downloadhdf5-68c01f91d94d1fa7a7cff198cb8daf6c89f05da7.zip
hdf5-68c01f91d94d1fa7a7cff198cb8daf6c89f05da7.tar.gz
hdf5-68c01f91d94d1fa7a7cff198cb8daf6c89f05da7.tar.bz2
[svn-r14154] Description:
Finish deprecating last H5G symbol (H5G_obj_t) - yay! Lots of misc. library fixes to remove confusion between links and objects. The tools could still use another pass, to remove h5trav_type_t type and make the correct distinction between links & objects. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'src/H5Glink.c')
-rw-r--r--src/H5Glink.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/H5Glink.c b/src/H5Glink.c
index bf01d34..7292245 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -720,10 +720,9 @@ done:
*/
herr_t
H5G_link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r,
- const char *lnk_name, H5L_type_t lnk_type, haddr_t lnk_addr)
+ const H5O_link_t *lnk)
{
H5RS_str_t *obj_path_r = NULL; /* Full path for link being removed */
- H5G_obj_t grp_obj_type; /* Type of link/object being deleted */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_link_name_replace, FAIL)
@@ -731,45 +730,10 @@ H5G_link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r,
/* check arguments */
HDassert(file);
- /* Look up the object type for each type of link */
- switch(lnk_type) {
- case H5L_TYPE_HARD:
- {
- H5O_loc_t tmp_oloc; /* Temporary object location */
- H5O_type_t obj_type; /* Type of object at location */
-
- /* Build temporary object location */
- tmp_oloc.file = file;
- tmp_oloc.addr = lnk_addr;
-
- /* Get the type of the object */
- if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type")
-
- /* Map to group object type */
- if(H5G_UNKNOWN == (grp_obj_type = H5G_map_obj_type(obj_type)))
- HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't determine object type")
- }
- break;
-
- case H5L_TYPE_SOFT:
- /* Get the object's type */
- grp_obj_type = H5G_LINK;
- break;
-
- default: /* User-defined link */
- if(lnk_type < H5L_TYPE_UD_MIN)
- HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unknown link type")
-
- /* Get the object's type */
- grp_obj_type = H5G_UDLINK;
- } /* end switch */
-
/* Search the open IDs and replace names for unlinked object */
if(grp_full_path_r) {
- obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk_name);
- if(H5G_name_replace(grp_obj_type, file, obj_path_r,
- NULL, NULL, NULL, H5G_NAME_DELETE) < 0)
+ obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name);
+ if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL, dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name")
} /* end if */