diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-09-19 18:16:07 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-09-19 18:16:07 (GMT) |
commit | 359d51effedde76636e0a65f0580b6bcfcb5753d (patch) | |
tree | 5c5381f522287f3b2e9a7f965fdad37a8260edb7 /src/H5FF.c | |
parent | 0b2feea6531fb9458279c08432357175e2db7cfa (diff) | |
download | hdf5-359d51effedde76636e0a65f0580b6bcfcb5753d.zip hdf5-359d51effedde76636e0a65f0580b6bcfcb5753d.tar.gz hdf5-359d51effedde76636e0a65f0580b6bcfcb5753d.tar.bz2 |
[svn-r24170] - add properties to dxpl and fapl for raw and metadata integrity verification scope (still ignored for now).
- update interface for H5Fopen_ff to switch order of *rcxt_id and eq_id
Diffstat (limited to 'src/H5FF.c')
-rw-r--r-- | src/H5FF.c | 146 |
1 files changed, 145 insertions, 1 deletions
@@ -113,6 +113,150 @@ H5FF__init_interface(void) /*------------------------------------------------------------------------- + * Function: H5Pset_metadata_integrity_scope + * + * Purpose: Set the scope of checksum generation and verification + * in the FF stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_metadata_integrity_scope(hid_t fapl_id, uint32_t scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + if(H5_CHECKSUM_NONE > scope || scope > H5_CHECKSUM_ALL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set property */ + if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_metadata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_metadata_integrity_scope + * + * Purpose: Get the current bit flag indicating the data integrity scope. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_metadata_integrity_scope(hid_t fapl_id, uint32_t *scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(scope) { + /* Get property */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_metadata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_rawdata_integrity_scope + * + * Purpose: Set the scope of checksum generation and verification + * in the FF stack. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_rawdata_integrity_scope(hid_t dxpl_id, uint32_t scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + if(H5_CHECKSUM_NONE > scope || scope > H5_CHECKSUM_ALL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid scope for Data Integrity"); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set property */ + if(H5P_set(plist, H5VL_CS_BITFLAG_NAME, &scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set data integrity scope"); + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_rawdata_integrity_scope() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_rawdata_integrity_scope + * + * Purpose: Get the current bit flag indicating the data integrity scope. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * September 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_rawdata_integrity_scope(hid_t dxpl_id, uint32_t *scope) +{ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(scope) { + /* Get property */ + if(H5P_get(plist, H5VL_CS_BITFLAG_NAME, scope) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_rawdata_integrity_scope() */ + + +/*------------------------------------------------------------------------- * Function: H5Fcreate_ff * * Purpose: Asynchronous wrapper around H5Fcreate(). @@ -196,7 +340,7 @@ done: */ hid_t H5Fopen_ff(const char *filename, unsigned flags, hid_t fapl_id, - hid_t eq_id, /*OUT*/hid_t *rcxt_id) + /*OUT*/hid_t *rcxt_id, hid_t eq_id) { void *file = NULL; /* file token from VOL plugin */ H5VL_t *vol_plugin; /* VOL plugin information */ |