summaryrefslogtreecommitdiffstats
path: root/src/H5L.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/H5L.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/H5L.c')
-rw-r--r--src/H5L.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/src/H5L.c b/src/H5L.c
index 51ff5db..49ef879 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -2363,7 +2363,6 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
{
H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */
H5L_trav_mv2_t udata_out; /* User data for H5L_move_dest_cb traversal */
- H5G_obj_t type; /* Type of object being moved */
char * orig_name = NULL; /* The name of the link in this group */
hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2378,29 +2377,6 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
if(lnk == NULL)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy")
- /* Get object type */
- switch(lnk->type) {
- case H5L_TYPE_HARD:
- {
- H5O_type_t obj_type; /* Type of object at location */
-
- if(H5O_obj_type(obj_loc->oloc, &obj_type, udata->dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type")
- if(H5G_UNKNOWN == (type = H5G_map_obj_type(obj_type)))
- HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "unknown object type to move")
- }
- break;
-
- case H5L_TYPE_SOFT:
- type = H5G_LINK;
- break;
-
- default:
- if(lnk->type < H5L_TYPE_UD_MIN)
- HGOTO_ERROR(H5E_LINK, H5E_BADTYPE, FAIL, "unrecognized link type")
- type = H5G_UDLINK;
- } /* end switch */
-
/* Set up user data for move_dest_cb */
if((udata_out.lnk = (H5O_link_t *)H5O_msg_copy(H5O_LINK_ID, lnk, NULL)) == NULL)
HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy link to be moved")
@@ -2427,12 +2403,22 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
if(!udata->copy) {
H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */
- /* Fix names up */
- dst_name_r = H5RS_wrap(udata->dst_name);
+ /* Make certain that the destination name is a full (not relative) path */
+ if(*(udata->dst_name) != '/') {
+ HDassert(udata->dst_loc->path->full_path_r);
+
+ /* Create reference counted string for full dst path */
+ if((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r,
+ udata->dst_name)) == NULL)
+ HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build destination path name")
+ } /* end if */
+ else
+ dst_name_r = H5RS_wrap(udata->dst_name);
HDassert(dst_name_r);
- if(H5G_name_replace(type, obj_loc->oloc->file, obj_loc->path->full_path_r,
- dst_name_r, udata->dst_loc->oloc->file, udata->dst_loc->path->full_path_r,
- H5G_NAME_MOVE) < 0) {
+
+ /* Fix names up */
+ if(H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r,
+ udata->dst_loc->oloc->file, dst_name_r, udata->dxpl_id) < 0) {
H5RS_decr(dst_name_r);
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name")
} /* end if */