diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-27 18:00:37 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-01-27 18:00:37 (GMT) |
commit | 36e7c7f9889b4fec640ebeeeed2afc38f2974524 (patch) | |
tree | 7878fc5d8a35bb04c264decd9b3ab017dd96ba11 /src | |
parent | b170a0a6c608d6346f7aa49452024d9185fad518 (diff) | |
download | hdf5-36e7c7f9889b4fec640ebeeeed2afc38f2974524.zip hdf5-36e7c7f9889b4fec640ebeeeed2afc38f2974524.tar.gz hdf5-36e7c7f9889b4fec640ebeeeed2afc38f2974524.tar.bz2 |
[svn-r24649] Add two new routines:
herr_t H5TRget_trans_num(hid_t trans_id, uint64_t *trans_num);
herr_t H5TRget_version_num(hid_t trans_id, uint64_t *version);
to retrieve information about a transaction.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5TR.c | 38 | ||||
-rw-r--r-- | src/H5TRpublic.h | 2 |
2 files changed, 40 insertions, 0 deletions
@@ -361,6 +361,44 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5TR_create() */ +herr_t +H5TRget_trans_num(hid_t trans_id, uint64_t *trans_num) +{ + H5TR_t *tr = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Il", trans_id, trans_num); + + /* get the TR object */ + if(NULL == (tr = (H5TR_t *)H5I_object_verify(trans_id, H5I_TR))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a transaction ID") + + *trans_num = tr->trans_num; + +done: + FUNC_LEAVE_API(ret_value) +} /* H5TRget_trans_num */ + +herr_t +H5TRget_version_num(hid_t trans_id, uint64_t *version) +{ + H5TR_t *tr = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Il", trans_id, version); + + /* get the TR object */ + if(NULL == (tr = (H5TR_t *)H5I_object_verify(trans_id, H5I_TR))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a transaction ID") + + *version = tr->c_version; + +done: + FUNC_LEAVE_API(ret_value) +} /* H5TRget_version_num */ + /*------------------------------------------------------------------------- * Function: H5TRstart diff --git a/src/H5TRpublic.h b/src/H5TRpublic.h index 65a72eb..a66d24b 100644 --- a/src/H5TRpublic.h +++ b/src/H5TRpublic.h @@ -51,6 +51,8 @@ extern "C" { /* API wrappers */ H5_DLL hid_t H5TRcreate(hid_t file_id, hid_t rc_id, uint64_t trans_num); +H5_DLL herr_t H5TRget_trans_num(hid_t trans_id, uint64_t *trans_num); +H5_DLL herr_t H5TRget_version_num(hid_t trans_id, uint64_t *version); H5_DLL herr_t H5TRstart(hid_t trans_id, hid_t trspl_id, hid_t estack_id); H5_DLL herr_t H5TRfinish(hid_t trans_id, hid_t trfpl_id, hid_t *rcntxt_id, hid_t estack_id); H5_DLL herr_t H5TRskip(hid_t file_id, uint64_t start_trans_num, uint64_t count, hid_t estack_id); |