summaryrefslogtreecommitdiffstats
path: root/src/H5Gtraverse.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-10 03:03:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-10 03:03:30 (GMT)
commit5a2c6b0ae10a93acc8e1fc2c058da5f6f5ee11da (patch)
tree9525258a8a09b6a1dab203796553f89e785d1d04 /src/H5Gtraverse.c
parent68ec8c72bc2f58b5a402e82337315b26b85ef7d3 (diff)
downloadhdf5-5a2c6b0ae10a93acc8e1fc2c058da5f6f5ee11da.zip
hdf5-5a2c6b0ae10a93acc8e1fc2c058da5f6f5ee11da.tar.gz
hdf5-5a2c6b0ae10a93acc8e1fc2c058da5f6f5ee11da.tar.bz2
[svn-r12221] Purpose:
"Hide" file format changes (for now) Description: Add ifdef's (controlled by the --enable-group-revision configure flag) to disable group revision changes to the file format, in order to allow alpha release to go ahead without releasing an unsupported version into the wild. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 32-bit (heping) Linux 2.4 64-bit (mir) Solaris 2.9 (shanti)
Diffstat (limited to 'src/H5Gtraverse.c')
-rw-r--r--src/H5Gtraverse.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c
index 60ab54b..1df90d1 100644
--- a/src/H5Gtraverse.c
+++ b/src/H5Gtraverse.c
@@ -397,7 +397,14 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
/* If there's valid information in the link, reset it */
if(link_valid) {
+#ifdef H5_GROUP_REVISION
H5O_reset(H5O_LINK_ID, &lnk);
+#else /* H5_GROUP_REVISION */
+ /* Free information for link (but don't free link pointer) */
+ if(lnk.type == H5G_LINK_SOFT)
+ lnk.u.soft.name = H5MM_xfree(lnk.u.soft.name);
+ lnk.name = H5MM_xfree(lnk.name);
+#endif /* H5_GROUP_REVISION */
link_valid = FALSE;
} /* end if */
@@ -479,15 +486,21 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target,
if(lookup_status < 0) {
/* If an intermediate group doesn't exist & flag is set, create the group */
if(target & H5G_CRT_INTMD_GROUP) {
+#ifdef H5_GROUP_REVISION
H5O_ginfo_t ginfo; /* Group info message for parent group */
/* Get the group info for parent group */
if(NULL == H5O_read(grp_loc.oloc, H5O_GINFO_ID, 0, &ginfo, dxpl_id))
HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info")
+#endif /* H5_GROUP_REVISION */
/* Create the intermediate group */
/* XXX: Should we allow user to control the group creation params here? -QAK */
- if(H5G_obj_create(grp_oloc.file, dxpl_id, &ginfo, obj_loc.oloc/*out*/) < 0)
+ if(H5G_obj_create(grp_oloc.file, dxpl_id,
+#ifdef H5_GROUP_REVISION
+ &ginfo,
+#endif /* H5_GROUP_REVISION */
+ obj_loc.oloc/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry")
/* Insert new group into current group's symbol table */
@@ -534,8 +547,16 @@ done:
if(obj_loc_valid)
H5G_loc_free(&obj_loc);
/* If there's valid information in the link, reset it */
- if(link_valid)
+ if(link_valid) {
+#ifdef H5_GROUP_REVISION
H5O_reset(H5O_LINK_ID, &lnk);
+#else /* H5_GROUP_REVISION */
+ /* Free information for link (but don't free link pointer) */
+ if(lnk.type == H5G_LINK_SOFT)
+ lnk.u.soft.name = H5MM_xfree(lnk.u.soft.name);
+ lnk.name = H5MM_xfree(lnk.name);
+#endif /* H5_GROUP_REVISION */
+ } /* end if */
/* If we copied something into the group location, free it */
if(group_copy)
H5G_loc_free(&grp_loc);