summaryrefslogtreecommitdiffstats
path: root/src/H5R.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-04-14 22:21:54 (GMT)
commit2521c4084c06f078846fe06bb1d3cd7bfa506316 (patch)
tree466b9213c163d812778434bba2097705b423e799 /src/H5R.c
parent3468ff3a5c4f6c384801edef9ae52ecc4f2de3c5 (diff)
downloadhdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.zip
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.gz
hdf5-2521c4084c06f078846fe06bb1d3cd7bfa506316.tar.bz2
[svn-r12254] Purpose:
Anti-feature Description: Revert changes to H5G_stat_t struct, to make it compatible with the 1.6.x branch again. The information that was added to the H5G_stat_t struct will be reported through other API routines. Platforms tested: FreeBSD 4.11 (sleipnir) w/C++ Linux 2.4/64 (mir) w/C++ & Fortran Solaris 2.9 (shanti)
Diffstat (limited to 'src/H5R.c')
-rw-r--r--src/H5R.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/H5R.c b/src/H5R.c
index 35f1313..0e06384 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -137,7 +137,10 @@ H5R_term_interface(void)
static herr_t
H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id)
{
- H5G_stat_t sb; /* Stat buffer for retrieving OID */
+ H5G_loc_t obj_loc; /* Group hier. location of object */
+ H5G_name_t path; /* Object group hier. path */
+ H5O_loc_t oloc; /* Object object location */
+ hbool_t obj_found = FALSE; /* Object location found */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5R_create)
@@ -147,15 +150,22 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5
HDassert(name);
HDassert(ref_type > H5R_BADTYPE || ref_type < H5R_MAXTYPE);
- if(H5G_get_objinfo(loc, name, 0, &sb, dxpl_id) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "unable to stat object")
+ /* Set up object location to fill in */
+ obj_loc.oloc = &oloc;
+ obj_loc.path = &path;
+ H5G_loc_reset(&obj_loc);
+
+ /* Find the object */
+ if(H5G_loc_find(loc, name, &obj_loc, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found")
+ obj_found = TRUE;
switch(ref_type) {
case H5R_OBJECT:
{
hobj_ref_t *ref = (hobj_ref_t *)_ref; /* Get pointer to correct type of reference struct */
- *ref=sb.u.obj.objno;
+ *ref = obj_loc.oloc->addr;
break;
}
@@ -202,7 +212,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5
/* Serialize information for dataset OID */
p = (uint8_t *)buf;
- H5F_addr_encode(loc->oloc->file, &p, sb.u.obj.objno);
+ H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr);
/* Serialize the selection */
if(H5S_SELECT_SERIALIZE(space, p) < 0)
@@ -234,6 +244,9 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5
} /* end switch */
done:
+ if(obj_found)
+ H5G_loc_free(&obj_loc);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5R_create() */