diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-21 20:22:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-21 20:22:11 (GMT) |
commit | e9262d7320615d78d32d777a416e34b01072191f (patch) | |
tree | 8c42f6d8e4519fbeaf66138f3c6337479e49e3e8 /src/H5D.c | |
parent | 102170c3bfc6fa3583f960ba970eb612567b1c05 (diff) | |
download | hdf5-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/H5D.c')
-rw-r--r-- | src/H5D.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -533,6 +533,7 @@ H5Dopen(hid_t loc_id, const char *name) H5G_loc_t dset_loc; /* Object location of dataset */ H5G_name_t path; /* Dataset group hier. path */ H5O_loc_t oloc; /* Dataset object location */ + H5O_type_t obj_type; /* Type of object at location */ hbool_t loc_found = FALSE; /* Location at 'name' found */ hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; @@ -557,7 +558,9 @@ H5Dopen(hid_t loc_id, const char *name) loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, dxpl_id) != H5G_DATASET) + if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") /* Open the dataset */ @@ -611,6 +614,7 @@ H5Dopen_expand(hid_t loc_id, const char *name, hid_t dapl_id) H5G_loc_t dset_loc; /* Object location of dataset */ H5G_name_t path; /* Dataset group hier. path */ H5O_loc_t oloc; /* Dataset object location */ + H5O_type_t obj_type; /* Type of object at location */ hbool_t loc_found = FALSE; /* Location at 'name' found */ hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; @@ -642,7 +646,9 @@ H5Dopen_expand(hid_t loc_id, const char *name, hid_t dapl_id) loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, dxpl_id) != H5G_DATASET) + if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") /* Open the dataset */ |