summaryrefslogtreecommitdiffstats
path: root/src/H5Itest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-03-15 21:54:30 (GMT)
commit4a17aff4085ad6ee265b95730aca3f493056dec8 (patch)
tree8bfb665c6d95a2e3520fa1bb0ff54d95aff3923f /src/H5Itest.c
parent853ae26333592faf69cd8c454ef92ffea8549df5 (diff)
downloadhdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.zip
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.gz
hdf5-4a17aff4085ad6ee265b95730aca3f493056dec8.tar.bz2
Add API context interface and use it throughout the library.
Diffstat (limited to 'src/H5Itest.c')
-rw-r--r--src/H5Itest.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/H5Itest.c b/src/H5Itest.c
index e7bd2a7..87aa7b9 100644
--- a/src/H5Itest.c
+++ b/src/H5Itest.c
@@ -30,6 +30,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
#include "H5Ipkg.h" /* IDs */
@@ -78,6 +79,7 @@ ssize_t
H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached)
{
H5G_loc_t loc; /* Object location */
+hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -86,11 +88,19 @@ H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached)
if(H5G_loc(id, &loc) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location")
+/* Set API context */
+if(H5CX_push() < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+api_ctx_pushed = TRUE;
+
/* Call internal group routine to retrieve object's name */
- if((ret_value = H5G_get_name(&loc, name, size, cached, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0)
+ if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
done:
+if(api_ctx_pushed && H5CX_pop() < 0)
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_get_name_test() */