diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-03-26 20:47:38 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-03-26 20:47:38 (GMT) |
commit | 04b257f380589c9136005695921bafdb5aa940fc (patch) | |
tree | 678709568728b1b6559b366c75ed6ac9a99bc1be /src/H5VL.c | |
parent | 53f19d479479ca9098bbb02d1fee2e471a23ce81 (diff) | |
download | hdf5-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/H5VL.c')
-rw-r--r-- | src/H5VL.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -938,12 +938,14 @@ H5VL_group_get(hid_t uid, H5VL_group_get_t get_type, int num_args, ...) { H5I_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ + H5I_type_t id_type; /* Type of ID */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + id_type = H5I_get_type(uid); /* Check/fix arguments. */ - if(H5I_GROUP_PUBLIC != H5I_get_type(uid)) + if(H5I_GROUP_PUBLIC != id_type && H5I_FILE_PUBLIC != id_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") /* get the ID struct */ @@ -1115,12 +1117,16 @@ H5VL_object_lookup(hid_t uid, H5VL_object_lookup_t lookup_type, int num_args, .. { H5I_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ + H5I_type_t id_type; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + id_type = H5I_get_type(uid); /* Check id */ - if(H5I_FILE_PUBLIC != H5I_get_type(uid) && H5I_GROUP_PUBLIC != H5I_get_type(uid)) + 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) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") /* lookup the ID struct */ @@ -1159,13 +1165,16 @@ H5VL_object_get(hid_t uid, H5VL_object_get_t get_type, int num_args, ...) { H5I_t *uid_info; /* user id structure */ va_list arguments; /* argument list passed from the API call */ + H5I_type_t id_type; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + id_type = H5I_get_type(uid); /* Check id */ - if(H5I_GROUP_PUBLIC != H5I_get_type(uid) && H5I_DATASET_PUBLIC != H5I_get_type(uid) && - H5I_DATATYPE_PUBLIC != H5I_get_type(uid) && H5I_FILE_PUBLIC != H5I_get_type(uid)) + if(H5I_GROUP_PUBLIC != id_type && H5I_DATASET_PUBLIC != id_type && + H5I_DATATYPE_PUBLIC != id_type && H5I_FILE_PUBLIC != id_type && + H5I_ATTRIBUTE_PUBLIC != id_type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a user ID") /* get the ID struct */ |