diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-10 17:54:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-10 17:54:20 (GMT) |
commit | ca1b9025fe8be1eab6bd76d58ab78bb9450c41f1 (patch) | |
tree | 905e707406ac64775824fe4c43627fb9e0cf2b46 /src/H5Itest.c | |
parent | 140f72b74847822e50bd10bb7051049b77f59abb (diff) | |
download | hdf5-ca1b9025fe8be1eab6bd76d58ab78bb9450c41f1.zip hdf5-ca1b9025fe8be1eab6bd76d58ab78bb9450c41f1.tar.gz hdf5-ca1b9025fe8be1eab6bd76d58ab78bb9450c41f1.tar.bz2 |
Switch switch remainder of API routines to use VOL callbacks.
Diffstat (limited to 'src/H5Itest.c')
-rw-r--r-- | src/H5Itest.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/H5Itest.c b/src/H5Itest.c index 4b54835..79bc482 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -78,26 +78,41 @@ ssize_t H5I__get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) { + H5VL_object_t *vol_obj; /* Object token of id */ H5G_loc_t loc; /* Object location */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t vol_wrapper_set = FALSE;/* Whether the VOL object wrapping context was set up */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE - /* Get object location */ - if(H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location") - /* Set API context */ if(H5CX_push() < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, (-1), "can't set API context") api_ctx_pushed = TRUE; + /* Get the object pointer */ + if(NULL == (vol_obj = H5VL_vol_object(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, (-1), "invalid identifier") + + /* Set wrapper info in API context */ + if(H5VL_set_vol_wrapper(vol_obj->data, vol_obj->connector) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "can't set VOL wrapper info") + vol_wrapper_set = TRUE; + + /* Get object location */ + if(H5G_loc(id, &loc) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location") + /* Call internal group routine to retrieve object's name */ if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name") done: + /* Reset object wrapping info in API context */ + if(vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) + HDONE_ERROR(H5E_ATOM, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info") + if(api_ctx_pushed && H5CX_pop() < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context") |