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/H5D.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/H5D.c')
-rw-r--r-- | src/H5D.c | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -123,6 +123,7 @@ hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id) { + H5P_genplist_t *plist; /* Property list pointer */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -153,9 +154,20 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") + /* Get the plist structure */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* set creation properties */ + if(H5P_set(plist, H5D_CRT_TYPE_ID_NAME, &type_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for datatype id") + if(H5P_set(plist, H5D_CRT_SPACE_ID_NAME, &space_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for space id") + if(H5P_set(plist, H5D_CRT_LCPL_ID_NAME, &lcpl_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for lcpl id") + /* Create the dataset through the VOL */ - if((ret_value = H5VL_dataset_create(loc_id, name, type_id, space_id, - lcpl_id, dcpl_id, dapl_id)) < 0) + if((ret_value = H5VL_dataset_create(loc_id, name, dcpl_id, dapl_id)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") done: @@ -203,6 +215,7 @@ hid_t H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, hid_t dapl_id) { + H5P_genplist_t *plist; /* Property list pointer */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -222,9 +235,18 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") + /* Get the plist structure */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* set creation properties */ + if(H5P_set(plist, H5D_CRT_TYPE_ID_NAME, &type_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for datatype id") + if(H5P_set(plist, H5D_CRT_SPACE_ID_NAME, &space_id) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for space id") + /* Create the dataset through the VOL */ - if((ret_value = H5VL_dataset_create(loc_id, NULL, type_id, space_id, - 0, dcpl_id, dapl_id)) < 0) + if((ret_value = H5VL_dataset_create(loc_id, NULL, dcpl_id, dapl_id)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") done: |