diff options
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -5273,3 +5273,71 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_set_latest_version() */ + +/*------------------------------------------------------------------------- + * Function: H5Tflush + * + * Purpose: Flushes all buffers associated with a named datatype to disk. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * May 19, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Tflush(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(H5Tflush, FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + + /* Call private function to flush datatype object */ + if (H5O_flush_metadata(&dt->oloc, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Tflush */ + + +/*------------------------------------------------------------------------- + * Function: H5Trefresh + * + * Purpose: Refreshes all buffers associated with a named datatype. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * July 21, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Trefresh(hid_t type_id) +{ + H5T_t * dt = NULL; + hid_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(H5Trefresh, FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + + /* Call private function to refresh datatype object */ + if ((H5O_refresh_metadata(type_id, dt->oloc, H5AC_dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Trefresh */ + |