diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-03-19 03:51:19 (GMT) |
commit | d812c6fe60fec2451d8d78b8fb51547628307a6c (patch) | |
tree | fb1f02516e6dfe5abce1cdb0155046b5d68a73d5 /src/H5L.c | |
parent | c31460c1b76c8d11534b57f025c57bdff9321f44 (diff) | |
download | hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.zip hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.gz hdf5-d812c6fe60fec2451d8d78b8fb51547628307a6c.tar.bz2 |
Cleanup API context function usage.
Diffstat (limited to 'src/H5L.c')
-rw-r--r-- | src/H5L.c | 215 |
1 files changed, 47 insertions, 168 deletions
@@ -304,7 +304,6 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -325,14 +324,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -347,8 +342,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lmove() */ @@ -373,7 +366,6 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -394,14 +386,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -416,8 +404,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcopy() */ @@ -445,7 +431,6 @@ H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; /* Group location for new link */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -461,21 +446,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create the link */ if(H5L__create_soft(link_target, &link_loc, link_name, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_soft() */ @@ -502,7 +481,6 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, { H5G_loc_t cur_loc, *cur_loc_p; H5G_loc_t new_loc, *new_loc_p; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -523,13 +501,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up current & new location pointers */ cur_loc_p = &cur_loc; @@ -546,8 +520,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_hard() */ @@ -581,7 +553,6 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -596,21 +567,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create external link */ if(H5L__create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_ud() */ @@ -636,7 +601,6 @@ herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -648,21 +612,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Unlink */ if(H5L__delete(&loc, name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete() */ @@ -691,7 +649,6 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -707,21 +664,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the link */ if(H5L__delete_by_idx(&loc, group_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete_by_idx() */ @@ -750,7 +701,6 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -762,21 +712,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ if(H5L__get_val(&loc, name, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val() */ @@ -805,7 +749,6 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -822,21 +765,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ if(H5L__get_val_by_idx(&loc, group_name, idx_type, order, n, buf, size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val_by_idx() */ @@ -858,7 +795,6 @@ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -870,21 +806,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Check for the existence of the link */ if((ret_value = H5L__exists(&loc, name)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lexists() */ @@ -908,7 +838,6 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -920,21 +849,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if(H5L__get_info(&loc, name, linfo) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info() */ @@ -959,7 +882,6 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; /* Group location for group to query */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -976,21 +898,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if(H5L__get_info_by_idx(&loc, group_name, idx_type, order, n, linfo) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info_by_idx() */ @@ -1149,7 +1065,6 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, char *name /*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1166,21 +1081,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ if((ret_value = H5L__get_name_by_idx(&loc, group_name, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_name_by_idx() */ @@ -1208,7 +1117,6 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1225,18 +1133,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Iterate over the links */ if((ret_value = H5L__iterate(grp_id, ".", idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate() */ @@ -1268,7 +1169,6 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1285,21 +1185,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Iterate over the links */ if((ret_value = H5L__iterate(loc_id, group_name, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate_by_name() */ @@ -1337,7 +1231,6 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1354,18 +1247,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal routine */ if((ret_value = H5L__visit(grp_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit() */ @@ -1402,7 +1288,6 @@ herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1419,21 +1304,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if((ret_value = H5L__visit(loc_id, group_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit_by_name() */ |