diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-21 01:18:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-21 01:18:55 (GMT) |
commit | f6deaca1d4cca061273cd6daef0357200d4c6ea4 (patch) | |
tree | c3c79ba33c986d048bdfbf21c493a8b2206c6818 /src/H5Glink.c | |
parent | 51da322882c72fa1c9e5c173b6e60ec283f7b4a1 (diff) | |
download | hdf5-f6deaca1d4cca061273cd6daef0357200d4c6ea4.zip hdf5-f6deaca1d4cca061273cd6daef0357200d4c6ea4.tar.gz hdf5-f6deaca1d4cca061273cd6daef0357200d4c6ea4.tar.bz2 |
[svn-r12954] Description:
Initial refactoring to prepare for H5Oopen_by_idx() API support.
Tested on:
Linux/32 2.4 (chicago)
Linux/64 2.4 (chicago2)
Diffstat (limited to 'src/H5Glink.c')
-rw-r--r-- | src/H5Glink.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/H5Glink.c b/src/H5Glink.c index b0966d7..e984a91 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -415,6 +415,54 @@ done: /*------------------------------------------------------------------------- + * Function: H5G_link_to_loc + * + * Purpose: Build group location from group and link object + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Monday, November 20 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5G_link_to_loc, FAIL) + + /* Sanity check */ + HDassert(grp_loc); + HDassert(lnk); + HDassert(obj_loc); + + /* + * Build location from the link + */ + + /* Check for unknown library-internal link */ + if(lnk->type > H5L_TYPE_BUILTIN_MAX && lnk->type < H5L_TYPE_UD_MIN) + HGOTO_ERROR(H5E_SYM, H5E_UNSUPPORTED, FAIL, "unknown link type") + + /* Build object's group hier. location */ + if(H5G_name_set(grp_loc->path, obj_loc->path, lnk->name) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot set name") + + /* Set the object location, if it's a hard link set the address also */ + obj_loc->oloc->file = grp_loc->oloc->file; + obj_loc->oloc->holding_file = FALSE; + if(lnk->type == H5L_TYPE_HARD) + obj_loc->oloc->addr = lnk->u.hard.addr; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_link_to_loc() */ + + +/*------------------------------------------------------------------------- * Function: H5G_link_copy_file * * Purpose: Copy a link and the object it points to from one file to |