diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-06 22:44:35 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-07-06 22:44:35 (GMT) |
commit | 843ccf86dd147e245bab269520741b0f103b4d6b (patch) | |
tree | 0af8a96abba787fa04f1d3d92af2400066fa133d /src/H5A.c | |
parent | 7a070012c08c4ef16a6effc01e03c2ca7cd8fa00 (diff) | |
download | hdf5-843ccf86dd147e245bab269520741b0f103b4d6b.zip hdf5-843ccf86dd147e245bab269520741b0f103b4d6b.tar.gz hdf5-843ccf86dd147e245bab269520741b0f103b4d6b.tar.bz2 |
[svn-r22523] - rework how IDs for VOL objects are created
- change how the vlose routine is registered with VOL IDs
- some bug fixes
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 48 |
1 files changed, 12 insertions, 36 deletions
@@ -140,7 +140,8 @@ H5A_init_interface(void) /* * Create attribute ID type. */ - if(H5I_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, NULL) < H5I_FILE) + if(H5I_register_type2(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, + NULL, (H5I_free2_t)H5A_close_attr) < H5I_FILE) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface") done: @@ -267,13 +268,8 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -371,13 +367,8 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -441,13 +432,8 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -523,13 +509,8 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -614,13 +595,8 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: |