diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-04-04 21:48:46 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-04-04 21:48:46 (GMT) |
commit | b56de62ae06434c5966fc07664c44d91b407c515 (patch) | |
tree | a75e027d145bc5a973eeca33376e98b0ca4a0c93 /src/H5A.c | |
parent | 668df7889cdb78ddf5c05ba6846794991d1ed826 (diff) | |
download | hdf5-b56de62ae06434c5966fc07664c44d91b407c515.zip hdf5-b56de62ae06434c5966fc07664c44d91b407c515.tar.gz hdf5-b56de62ae06434c5966fc07664c44d91b407c515.tar.bz2 |
[svn-r22250] - fix most of issues from code review
- object open routines fall back to the generic VL object open in case the specific call back is not impemented
- H5L VOL create/copy/move routines
- make VOL create routines have similar interface and stuff parameters in creation plist
- some bug fixes
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -245,7 +245,22 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, /* Go do the real work for attaching the attribute to the dataset */ if((ret_value = H5A_create(&loc, attr_name, type, space, acpl_id, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") +#if 0 + hid_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, acpl_id, aapl_id); + /* check arguments */ + if(H5I_ATTR_PUBLIC == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if(!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + + /* Create the attribute through the VOL */ + if((ret_value = H5VL_attr_create(loc_id, attr_name, type_id, space_id, acpl_id, aapl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") +#endif done: FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ @@ -330,6 +345,16 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if((ret_value = H5A_create(&obj_loc, attr_name, type, space, acpl_id, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") +#if 0 + /* Get the token for the Object location through the VOL */ + if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, obj_name, lapl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + + /* Create the attribute through the VOL */ + if((ret_value = H5VL_attr_create(loc_id, attr_name, type_id, space_id, acpl_id, aapl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") +#endif + done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) |