summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-04-09 22:17:52 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-04-09 22:17:52 (GMT)
commit0dbc51127e4b4bc2f3ada3b0958cc9dc2607c541 (patch)
tree6c6a2d732b70389e350f4f01b3920211e186de36 /src/H5I.c
parent7d7842302b1dcf0da0067b30c49da59b8f766cb3 (diff)
downloadhdf5-0dbc51127e4b4bc2f3ada3b0958cc9dc2607c541.zip
hdf5-0dbc51127e4b4bc2f3ada3b0958cc9dc2607c541.tar.gz
hdf5-0dbc51127e4b4bc2f3ada3b0958cc9dc2607c541.tar.bz2
[svn-r22271] unwrap the high level ids in several places
add some workarounds for named datatypes in test cases and H5T routines fix some iterate bugs with UD links
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/src/H5I.c b/src/H5I.c
index d60d405..617b7a4 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -2156,25 +2156,12 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5Iget_file_id(hid_t uid)
+H5Iget_file_id(hid_t id)
{
- H5VL_id_wrapper_t *id_wrapper; /* user id structure */
- hid_t id;
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE1("i", "i", uid);
-
- if (H5I_FILE_PUBLIC == H5I_get_type(uid) || H5I_GROUP_PUBLIC == H5I_get_type(uid) ||
- H5I_DATASET_PUBLIC == H5I_get_type(uid) || H5I_DATATYPE_PUBLIC == H5I_get_type(uid) ||
- H5I_ATTR_PUBLIC == H5I_get_type(uid)) {
- if(NULL == (id_wrapper = (H5VL_id_wrapper_t *)H5I_object(uid)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier")
- id = id_wrapper->obj_id;
- }
- else {
- id = uid;
- }
+ H5TRACE1("i", "i", id);
if((ret_value = H5I_get_file_id(id, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID")
@@ -2205,10 +2192,25 @@ hid_t
H5I_get_file_id(hid_t obj_id, hbool_t app_ref)
{
H5I_type_t type; /* ID type */
+ H5I_type_t id_type;
hid_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
+ id_type = H5I_get_type(obj_id);
+ /* get the actual OBJ_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_ATTR_PUBLIC == id_type) {
+ H5VL_id_wrapper_t *id_wrapper; /* user id structure */
+ if(NULL == (id_wrapper = (H5VL_id_wrapper_t *)H5I_object(obj_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier")
+ obj_id = id_wrapper->obj_id;
+ }
+
/* Get object type */
type = H5I_TYPE(obj_id);
if(H5I_FILE == type) {
@@ -2280,6 +2282,12 @@ H5VL_replace_with_uids(hid_t *old_list, ssize_t num_ids)
else if (H5I_DATASET == type) {
type_ptr = H5I_id_type_list_g[H5I_DATASET_PUBLIC];
}
+ else if (H5I_DATATYPE == type) {
+ type_ptr = H5I_id_type_list_g[H5I_DATATYPE_PUBLIC];
+ }
+ else if (H5I_ATTR == type) {
+ type_ptr = H5I_id_type_list_g[H5I_ATTR_PUBLIC];
+ }
else {
ret_value ++;
continue;
@@ -2341,12 +2349,21 @@ H5VL_inc_ref_uid(hid_t id, hbool_t app_ref)
type = H5I_get_type(id);
- if (type == H5I_FILE) {
+ if (H5I_FILE == type) {
type_ptr = H5I_id_type_list_g[H5I_FILE_PUBLIC];
}
- else if (type = H5I_GROUP) {
+ else if (H5I_GROUP == type) {
type_ptr = H5I_id_type_list_g[H5I_GROUP_PUBLIC];
}
+ else if (H5I_DATASET == type) {
+ type_ptr = H5I_id_type_list_g[H5I_DATASET_PUBLIC];
+ }
+ else if (H5I_DATATYPE == type) {
+ type_ptr = H5I_id_type_list_g[H5I_DATATYPE_PUBLIC];
+ }
+ else if (H5I_ATTR == type) {
+ type_ptr = H5I_id_type_list_g[H5I_ATTR_PUBLIC];
+ }
else {
HGOTO_DONE(ret_value)
}