summaryrefslogtreecommitdiffstats
path: root/src/H5Adeprec.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-03-26 20:47:38 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-03-26 20:47:38 (GMT)
commit04b257f380589c9136005695921bafdb5aa940fc (patch)
tree678709568728b1b6559b366c75ed6ac9a99bc1be /src/H5Adeprec.c
parent53f19d479479ca9098bbb02d1fee2e471a23ce81 (diff)
downloadhdf5-04b257f380589c9136005695921bafdb5aa940fc.zip
hdf5-04b257f380589c9136005695921bafdb5aa940fc.tar.gz
hdf5-04b257f380589c9136005695921bafdb5aa940fc.tar.bz2
[svn-r22151] - object lookup returns the haddr_t
- make the VL implementation for all variations of H5Oopen, H5Oget_info, H5Gget_info common, by looking up the object location first.
Diffstat (limited to 'src/H5Adeprec.c')
-rw-r--r--src/H5Adeprec.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 22faaa2..75f644f 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -302,14 +302,33 @@ done:
Deprecated in favor of H5Oget_info
--------------------------------------------------------------------------*/
int
-H5Aget_num_attrs(hid_t loc_id)
+H5Aget_num_attrs(hid_t id)
{
H5O_loc_t *loc; /* Object location for attribute */
void *obj;
+ H5I_t *uid_info; /* user id structure */
+ hid_t loc_id;
+ H5I_type_t id_type;
int ret_value;
FUNC_ENTER_API(FAIL)
- H5TRACE1("Is", "i", loc_id);
+ H5TRACE1("Is", "i", id);
+
+ id_type = H5I_get_type(id);
+ /* get the actual ID from an upper ID level */
+ /* MSC - this is a workaround to allow the test suite to pass and
+ at some point needs to be removed once all high level operations
+ that needs to go through the VOL actually go through the VOL*/
+ if (H5I_FILE_PUBLIC == id_type || H5I_GROUP_PUBLIC == id_type ||
+ H5I_DATASET_PUBLIC == id_type || H5I_DATATYPE_PUBLIC == id_type ||
+ H5I_ATTRIBUTE_PUBLIC == id_type) {
+ if(NULL == (uid_info = (H5I_t *)H5I_object(id)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, NULL, "invalid user identifier")
+ loc_id = uid_info->obj_id;
+ }
+ else {
+ loc_id = id;
+ }
/* check arguments */
if(H5I_BADID == H5I_get_type(loc_id))