summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-21 20:22:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-21 20:22:11 (GMT)
commite9262d7320615d78d32d777a416e34b01072191f (patch)
tree8c42f6d8e4519fbeaf66138f3c6337479e49e3e8 /src/H5Gstab.c
parent102170c3bfc6fa3583f960ba970eb612567b1c05 (diff)
downloadhdf5-e9262d7320615d78d32d777a416e34b01072191f.zip
hdf5-e9262d7320615d78d32d777a416e34b01072191f.tar.gz
hdf5-e9262d7320615d78d32d777a416e34b01072191f.tar.bz2
[svn-r12963] Description:
Refactor internal code that retrieves the object's type to use the new H5O_type_t (which only definitions for object types, instead of links as well) instead of the older H5G_obj_t (which included links, etc.) Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index 76cefe1..c617d6e 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -696,9 +696,9 @@ static herr_t
H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata)
{
H5G_bt_it_gtbi_t *udata = (H5G_bt_it_gtbi_t *)_udata;
- H5O_loc_t tmp_oloc; /* Temporary object location */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_stab_get_type_by_idx_cb)
+ FUNC_ENTER_NOAPI_NOINIT(H5G_stab_get_type_by_idx_cb)
/* Sanity check */
HDassert(ent);
@@ -711,16 +711,25 @@ H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata)
break;
default:
- /* Build temporary object location */
- tmp_oloc.file = udata->common.f;
- HDassert(H5F_addr_defined(ent->header));
- tmp_oloc.addr = ent->header;
-
- udata->type = H5O_obj_type(&tmp_oloc, udata->common.dxpl_id);
+ {
+ H5O_loc_t tmp_oloc; /* Temporary object location */
+ H5O_type_t obj_type; /* Type of object at location */
+
+ /* Build temporary object location */
+ tmp_oloc.file = udata->common.f;
+ HDassert(H5F_addr_defined(ent->header));
+ tmp_oloc.addr = ent->header;
+
+ /* Get the type of the object */
+ if(H5O_obj_type(&tmp_oloc, &obj_type, udata->common.dxpl_id) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type")
+ udata->type = H5G_map_obj_type(obj_type);
+ }
break;
} /* end switch */
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_stab_get_type_by_idx_cb */