summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2002-08-28 18:34:12 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2002-08-28 18:34:12 (GMT)
commit7bff4eb559d3f28f27ab29ced0d1e46ada1df620 (patch)
tree26415f62114ac52c107ef88cacfb58218facbefa /src/H5F.c
parentfc5e3b4897f695b2d61518954047cc783c8baa1d (diff)
downloadhdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.zip
hdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.tar.gz
hdf5-7bff4eb559d3f28f27ab29ced0d1e46ada1df620.tar.bz2
[svn-r5904]
Purpose: Added 'ID to name' support Description: There is a new API function H5Iget_name Most of the changes are on H5G.c , regarding the symbol table entry struct H5G_entry_t which has 2 new fields 'name' and 'old_name' A new private function was introduced H5G_ent_copy, that does a deep copy between 2 symbol table entries The test file is getname.c Platforms tested: windows 2000, Linux, Solaris
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 564fefc..13421a1 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2912,9 +2912,12 @@ done:
*
* Modifications:
*
- * Robb Matzke, 1998-10-14
+ * Robb Matzke, 1998-10-14
* The ref count for the child is decremented by calling H5F_close().
*
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
+ * Added `id to name' support.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2954,6 +2957,11 @@ H5F_unmount(H5G_entry_t *loc, const char *name)
parent = child->mtab.parent;
for (i=0; i<parent->mtab.nmounts; i++) {
if (parent->mtab.child[i].file==child) {
+
+ /* Search the symbol table entry list and replace names through group IDs */
+ if (H5G_replace_name( H5G_UNKNOWN, loc, name, NULL, OP_UNMOUNT )<0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name ");
+
/* Unmount the child */
parent->mtab.nmounts -= 1;
H5G_close(parent->mtab.child[i].group);
@@ -3022,6 +3030,9 @@ done:
* Tuesday, October 6, 1998
*
* Modifications:
+ *
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
+ * Added `id to name' support.
*
*-------------------------------------------------------------------------
*/
@@ -3032,6 +3043,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/)
int lt, rt, md=(-1), cmp;
H5G_entry_t *ent = NULL;
herr_t ret_value=SUCCEED; /* Return value */
+ char *tmp;
FUNC_ENTER_NOAPI(H5F_mountpoint, FAIL);
@@ -3063,7 +3075,9 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/)
/* Copy root info over to ENT */
if (0==cmp) {
ent = H5G_entof(parent->mtab.child[md].file->shared->root_grp);
+ tmp = find->name;
*find = *ent;
+ find->name = tmp;
parent = ent->file;
}
} while (!cmp);
@@ -3086,6 +3100,9 @@ done:
*
* Modifications:
*
+ * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002
+ * Added `id to name' support.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3114,6 +3131,11 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id)
if (H5F_mount(loc, name, child, plist_id)<0)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file");
+ /* Search the symbol table entry list and replace names through group IDs */
+ /* We pass H5G_UNKNOWN as object type; search all IDs */
+ if (H5G_replace_name( H5G_UNKNOWN, loc, name, NULL, OP_MOUNT )<0)
+ HRETURN_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to replace name ");
+
done:
FUNC_LEAVE(ret_value);
}