diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 246 | ||||
-rw-r--r-- | src/H5Adeprec.c | 45 | ||||
-rw-r--r-- | src/H5Atest.c | 15 | ||||
-rw-r--r-- | src/H5D.c | 46 | ||||
-rw-r--r-- | src/H5Ddbg.c | 7 | ||||
-rw-r--r-- | src/H5Ddeprec.c | 34 | ||||
-rw-r--r-- | src/H5Dfill.c | 6 | ||||
-rw-r--r-- | src/H5Dio.c | 24 | ||||
-rw-r--r-- | src/H5Dscatgath.c | 14 | ||||
-rw-r--r-- | src/H5F.c | 136 | ||||
-rw-r--r-- | src/H5FD.c | 70 | ||||
-rw-r--r-- | src/H5Fdeprec.c | 8 | ||||
-rw-r--r-- | src/H5Fmount.c | 28 | ||||
-rw-r--r-- | src/H5Ftest.c | 30 | ||||
-rw-r--r-- | src/H5G.c | 114 | ||||
-rw-r--r-- | src/H5Gdeprec.c | 165 | ||||
-rw-r--r-- | src/H5Gtest.c | 98 | ||||
-rw-r--r-- | src/H5I.c | 15 | ||||
-rw-r--r-- | src/H5Itest.c | 14 | ||||
-rw-r--r-- | src/H5L.c | 215 | ||||
-rw-r--r-- | src/H5Lexternal.c | 13 | ||||
-rw-r--r-- | src/H5O.c | 195 | ||||
-rw-r--r-- | src/H5Ocopy.c | 13 | ||||
-rw-r--r-- | src/H5Oflush.c | 26 | ||||
-rw-r--r-- | src/H5Otest.c | 84 | ||||
-rw-r--r-- | src/H5P.c | 14 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 14 | ||||
-rw-r--r-- | src/H5R.c | 50 | ||||
-rw-r--r-- | src/H5Rdeprec.c | 16 | ||||
-rw-r--r-- | src/H5T.c | 33 | ||||
-rw-r--r-- | src/H5Tcommit.c | 76 | ||||
-rw-r--r-- | src/H5Tcompound.c | 8 | ||||
-rw-r--r-- | src/H5Tdeprec.c | 21 | ||||
-rw-r--r-- | src/H5Tnative.c | 7 | ||||
-rw-r--r-- | src/H5Z.c | 12 |
35 files changed, 421 insertions, 1491 deletions
@@ -251,7 +251,6 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -271,13 +270,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Go do the real work for attaching the attribute to the object */ if(NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) @@ -291,8 +286,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ @@ -337,7 +330,6 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -360,13 +352,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -386,8 +374,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate_by_name() */ @@ -417,7 +403,6 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -431,13 +416,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Read in attribute from object header */ if(NULL == (attr = H5A__open(&loc, attr_name))) @@ -452,8 +433,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen() */ @@ -486,7 +465,6 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -502,13 +480,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -529,8 +503,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_name() */ @@ -566,7 +538,6 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -585,13 +556,9 @@ 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_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, 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(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) @@ -612,8 +579,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_idx() */ @@ -640,7 +605,6 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -654,21 +618,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(attr_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(attr_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Go write the actual data to the attribute */ if((ret_value = H5A__write(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Awrite() */ @@ -694,7 +652,6 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -708,18 +665,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Go write the actual data to the attribute */ if((ret_value = H5A__read(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aread() */ @@ -780,7 +730,6 @@ hid_t H5Aget_type(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -790,17 +739,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - if((ret_value = H5A__get_type(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -916,7 +858,6 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -935,13 +876,9 @@ 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_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) @@ -961,8 +898,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_name_by_idx() */ @@ -1060,7 +995,6 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1078,13 +1012,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) @@ -1098,8 +1028,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_name() */ @@ -1125,7 +1053,6 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1146,13 +1073,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) @@ -1166,8 +1089,6 @@ done: /* Release resources */ if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ @@ -1189,7 +1110,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1208,13 +1128,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Call private attribute rename routine */ if(H5A__rename(&loc, old_name, new_name) < 0) @@ -1222,8 +1138,6 @@ if(H5CX_set_loc(loc_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename() */ @@ -1245,7 +1159,6 @@ herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1266,13 +1179,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(HDstrcmp(old_attr_name, new_attr_name)) { H5G_loc_t loc; /* Object location */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") @@ -1283,8 +1192,6 @@ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename_by_name() */ @@ -1334,7 +1241,6 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1348,18 +1254,11 @@ 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_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call attribute iteration routine */ if((ret_value = H5A__iterate(loc_id, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate2() */ @@ -1413,7 +1312,6 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1432,21 +1330,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_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call attribute iteration by name routine */ if((ret_value = H5A__iterate_by_name(&loc, obj_name, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate_by_name() */ @@ -1469,7 +1361,6 @@ herr_t H5Adelete(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1483,21 +1374,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_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Delete the attribute from the location */ if(H5A__delete(&loc, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1523,7 +1408,6 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1539,21 +1423,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ if(H5A__delete_by_name(&loc, obj_name, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_name() */ @@ -1587,7 +1465,6 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1605,21 +1482,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_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ if(H5A__delete_by_idx(&loc, obj_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_idx() */ @@ -1642,7 +1513,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Aclose(hid_t attr_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1651,17 +1521,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* check arguments */ if(NULL == H5I_object_verify(attr_id, H5I_ATTR)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Decrement references to that atom (and close it) */ if(H5I_dec_app_ref(attr_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aclose() */ @@ -1684,7 +1549,6 @@ htri_t H5Aexists(hid_t obj_id, const char *attr_name) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1698,18 +1562,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Check if the attribute exists */ if((ret_value = H5A__exists(&loc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists() */ @@ -1732,7 +1589,6 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1748,20 +1604,14 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, 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_ATTR, 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_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if ((ret_value = H5A__exists_by_name(loc, obj_name, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists_by_name() */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 1e031f7..84ab491 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -117,7 +117,6 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -137,13 +136,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") /* Go do the real work for attaching the attribute to the dataset */ if(NULL == (attr = H5A__create(&loc, name, type, space, acpl_id))) @@ -157,8 +152,6 @@ done: /* Cleanup on failure */ if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate1() */ @@ -191,7 +184,6 @@ H5Aopen_name(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -205,11 +197,6 @@ 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_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the attribute on the object header */ if(NULL == (attr = H5A__open_by_name(&loc, ".", name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) @@ -223,8 +210,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -257,7 +242,6 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -269,11 +253,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the attribute in the object header */ if(NULL == (attr = H5A__open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute") @@ -287,8 +266,6 @@ done: if(ret_value < 0) if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -317,7 +294,6 @@ H5Aget_num_attrs(hid_t loc_id) { H5O_loc_t *loc; /* Object location for attribute */ void *obj; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value; FUNC_ENTER_API(FAIL) @@ -363,18 +339,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "inappropriate attribute target") } /*lint !e788 All appropriate cases are covered */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Look up the # of attributes for the object */ if((ret_value = H5A__get_num_attrs(loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_num_attrs() */ @@ -419,7 +388,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -429,18 +397,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call attribute iteration routine */ if((ret_value = H5A__iterate_old(loc_id, attr_num, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Atest.c b/src/H5Atest.c index f7b7fd3..31fbe8e 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -127,7 +127,7 @@ herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { H5A_t *attr; /* Attribute object for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -135,9 +135,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); @@ -147,8 +149,9 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__get_shared_rc_test() */ @@ -136,9 +136,9 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new dataset & get its ID */ if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id))) @@ -215,9 +215,9 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* build and open the new dataset */ if(NULL == (dset = H5D__create_anon(loc.oloc->file, type_id, space, dcpl_id, dapl_id))) @@ -283,9 +283,9 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the dataset */ if(NULL == (dset = H5D__open_name(&loc, name, dapl_id))) @@ -753,8 +753,8 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Call internal routine */ ret_value = H5D_vlen_reclaim(type_id, space, buf); @@ -897,9 +897,9 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Private function */ if(H5D__set_extent(dset, size) < 0) @@ -935,9 +935,9 @@ H5Dflush(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush dataset information cached in memory */ if(H5D__flush(dset, dset_id) < 0) @@ -973,9 +973,9 @@ H5Drefresh(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh the dataset object */ if((H5D__refresh(dset_id, dset)) < 0) @@ -1015,9 +1015,9 @@ H5Dformat_convert(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") switch(dset->shared->layout.type) { case H5D_CHUNKED: diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 656fa91..347e34c 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -78,7 +78,6 @@ herr_t H5Ddebug(hid_t dset_id) { H5D_t *dset; /* Dataset to debug */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -87,10 +86,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) @@ -99,8 +94,6 @@ api_ctx_pushed = TRUE; HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ddebug() */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 51ebeba..318680c 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -116,7 +116,6 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ hid_t dapl_id = H5P_DEFAULT; /* DAPL used by library */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -137,13 +136,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Build and open the new dataset */ if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, dapl_id))) @@ -157,8 +152,6 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate1() */ @@ -186,7 +179,6 @@ H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -198,11 +190,6 @@ 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_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the dataset */ if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") @@ -215,8 +202,6 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ @@ -244,7 +229,6 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) H5D_t *dset; /* Pointer to dataset to modify */ hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */ unsigned u; /* Local index variable */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -264,21 +248,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(size[u] > dset_dims[u]) dset_dims[u] = size[u]; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dset_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Increase size */ if(H5D__set_extent(dset, dset_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dextend() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 668ecc3..e42e551 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -120,7 +120,6 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ H5S_t *space; /* Dataspace */ H5T_t *fill_type; /* Fill-value datatype */ H5T_t *buf_type; /* Buffer datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -135,17 +134,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") if(NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Fill the selection in the memory buffer */ if(H5D__fill(fill, fill_type, buf, buf_type, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dfill() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 5b5bb5e..334f18f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -118,7 +118,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_read = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -159,12 +158,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct read' flag */ if(H5CX_get_dcr_flag(&direct_read) < 0) @@ -216,9 +211,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ @@ -262,7 +254,6 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -282,12 +273,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct write' flag */ if(H5CX_get_dcw_flag(&direct_write) < 0) @@ -320,9 +307,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index f636eb7..5856ede 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -955,7 +955,6 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, size_t type_size; /* Datatype element size */ hssize_t nelmts; /* Number of remaining elements in selection */ size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -970,10 +969,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1024,8 +1019,6 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dscatter() */ @@ -1059,7 +1052,6 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, hssize_t nelmts; /* Number of remaining elements in selection */ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ size_t nelmts_gathered; /* Number of elements gathered from src_buf */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1077,10 +1069,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1130,8 +1118,6 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dgather() */ @@ -355,7 +355,6 @@ done: htri_t H5Fis_hdf5(const char *name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -364,10 +363,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args and all the boring stuff. */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* call the private is_HDF5 function */ /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ @@ -375,8 +370,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable open file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fis_hdf5() */ @@ -408,7 +401,6 @@ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -435,13 +427,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not file create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for @@ -465,8 +453,6 @@ if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) done: if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -495,7 +481,6 @@ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -515,13 +500,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((flags & H5F_ACC_SWMR_READ) && (flags & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR read access on a file open for read-write access is not allowed") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the file */ if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) @@ -538,8 +519,6 @@ done: if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fopen() */ @@ -559,7 +538,6 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) { H5F_t *f = NULL; /* File to flush */ H5O_loc_t *oloc = NULL; /* Object location for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -645,13 +623,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, 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(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, 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(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") /* Flush the file */ if(H5F__flush(f, scope) < 0) @@ -659,8 +633,6 @@ if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fflush() */ @@ -682,7 +654,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Fclose(hid_t file_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -692,18 +663,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5I_FILE != H5I_get_type(file_id)) HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Close the file */ if(H5F__close(file_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclose() */ @@ -823,7 +787,6 @@ H5Fget_freespace(hid_t file_id) { H5F_t *file; /* File object for file ID */ hsize_t tot_space; /* Amount of free space in the file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -833,11 +796,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the free space in the file */ if(H5F__get_freespace(file, &tot_space) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") @@ -845,8 +803,6 @@ api_ctx_pushed = TRUE; ret_value = (hssize_t)tot_space; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_freespace() */ @@ -932,7 +888,6 @@ ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { H5F_t *file; /* File object for file ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -942,19 +897,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* call private get_file_image function */ /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ if((ret_value = H5F__get_file_image(file, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file image") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Fget_file_image() */ @@ -1225,7 +1173,6 @@ herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1253,18 +1200,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ } /* end else */ HDassert(f->shared); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file info */ if(H5F__get_info(f, finfo) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info2() */ @@ -1380,7 +1320,6 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/) { H5F_t *file; /* Top file in mount hierarchy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1392,18 +1331,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the free-space section information in the file */ if((ret_value = H5F__get_free_sections(file, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_free_sections() */ @@ -1423,7 +1355,6 @@ herr_t H5Fclear_elink_file_cache(hid_t file_id) { H5F_t *file; /* File */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1434,20 +1365,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* See if there's an EFC */ - if(file->shared->efc) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - + if(file->shared->efc) /* Release the EFC */ if(H5F__efc_release(file->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") - } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ @@ -1488,7 +1411,6 @@ H5Fstart_swmr_write(hid_t file_id) H5F_t *file; /* File info */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1519,21 +1441,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(ci_load || ci_write ) HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(file_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ if(H5F__start_swmr_write(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fstart_swmr_write() */ @@ -1649,7 +1565,6 @@ herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high) { H5F_t *f; /* File */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1659,21 +1574,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(file_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal set_libver_bounds function */ if(H5F__set_libver_bounds(f, low, high) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fset_libver_bounds() */ @@ -1692,7 +1601,6 @@ herr_t H5Fformat_convert(hid_t fid) { H5F_t *f; /* File to flush */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1705,21 +1613,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (f = (H5F_t *)H5I_object(fid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(fid, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(fid, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call the internal routine */ if(H5F__format_convert(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fformat_convert() */ @@ -1024,7 +1024,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) @@ -1042,12 +1041,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, HADDR_UNDEF, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(HADDR_UNDEF == (ret_value = H5FD__alloc_real(file, type, size, NULL, NULL))) @@ -1057,8 +1053,6 @@ H5CX_set_dxpl(dxpl_id); ret_value += file->base_addr; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, HADDR_UNDEF, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDalloc() */ @@ -1082,7 +1076,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1098,12 +1091,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1111,8 +1101,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDfree() */ @@ -1378,7 +1366,6 @@ herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1397,12 +1384,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1410,8 +1393,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDread() */ @@ -1434,7 +1415,6 @@ herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1452,12 +1432,8 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* The real work */ /* (Note compensating for base address addition in internal routine) */ @@ -1465,8 +1441,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDwrite() */ @@ -1489,7 +1463,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1503,20 +1476,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(H5FD_flush(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDflush() */ @@ -1562,7 +1530,6 @@ done: herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1576,20 +1543,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Do the real work */ if(H5FD_truncate(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDtruncate() */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 74507f0..6417956 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -102,7 +102,6 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ H5F_info2_t finfo2; /* Current file info struct */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -130,11 +129,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ } /* end else */ HDassert(f->shared); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the current file info */ if(H5F__get_info(f, &finfo2) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") @@ -145,8 +139,6 @@ api_ctx_pushed = TRUE; finfo->sohm.msgs_info = finfo2.sohm.msgs_info; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index a8228d8..eede84c 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -443,7 +443,6 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) { H5G_loc_t loc; H5F_t *child = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -462,22 +461,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Do the mount */ if(H5F__mount(&loc, name, child, plist_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Fmount() */ @@ -505,7 +497,6 @@ herr_t H5Funmount(hid_t loc_id, const char *name) { 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) @@ -517,22 +508,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_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Unmount */ if(H5F__unmount(&loc, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") - FUNC_LEAVE_API(ret_value) } /* end H5Funmount() */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index df062ff..bdecad2 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -99,7 +99,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count) { H5F_t *file; /* File info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -107,17 +107,20 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Retrieve count for message type */ if(H5SM__get_mesg_count_test(file, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_sohm_mesg_count_test() */ @@ -142,7 +145,7 @@ herr_t H5F_check_cached_stab_test(hid_t file_id) { H5F_t *file; /* File info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -150,17 +153,20 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + + /* Push API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Verify the cached stab info */ if(H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_check_cached_stab_test() */ @@ -289,7 +289,6 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, { H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -315,13 +314,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new group & get its ID */ if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id))) @@ -334,8 +329,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -381,7 +374,6 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) H5G_loc_t loc; H5G_t *grp = NULL; H5G_obj_create_t gcrt_info; /* Information for group creation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(H5I_INVALID_HID) @@ -398,13 +390,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -436,8 +424,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -464,7 +450,6 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -476,13 +461,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the group */ if(NULL == (grp = H5G__open_name(&loc, name))) @@ -497,8 +478,6 @@ done: if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -523,7 +502,6 @@ hid_t H5Gget_create_plist(hid_t group_id) { H5G_t *group = NULL; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -533,17 +511,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - if((ret_value = H5G__get_create_plist(group)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_create_plist() */ @@ -566,7 +537,6 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) { H5I_type_t id_type; /* Type of ID */ H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -583,18 +553,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(grp_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the group's information */ if(H5G__get_info(&loc, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info() */ @@ -617,7 +580,6 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -631,21 +593,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, 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_SYM, 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_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ if(H5G__get_info_by_name(&loc, name, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_name() */ @@ -669,7 +625,6 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -688,21 +643,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, 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_SYM, 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_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ if(H5G__get_info_by_idx(&loc, group_name, idx_type, order, n, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_idx() */ @@ -723,7 +672,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Gclose(hid_t group_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -732,10 +680,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check args */ if(NULL == H5I_object_verify(group_id,H5I_GROUP)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* * Decrement the counter on the group atom. It will be freed if the count @@ -745,8 +689,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gclose() */ @@ -767,7 +709,6 @@ herr_t H5Gflush(hid_t group_id) { H5G_t *grp; /* Group for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -777,21 +718,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(group_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Flush group's metadata to file */ if(H5G__flush(grp, group_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Gflush */ @@ -812,7 +747,6 @@ herr_t H5Grefresh(hid_t group_id) { H5G_t *grp; /* Group for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -822,21 +756,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(group_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call private function to refresh group object */ if((H5G__refresh(grp, group_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Grefresh */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 5835e06..8d1441f 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -190,7 +190,6 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -231,13 +230,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Create the new group & get its ID */ if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl))) @@ -253,8 +248,6 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate1() */ @@ -282,7 +275,6 @@ H5Gopen1(hid_t loc_id, const char *name) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -294,11 +286,6 @@ 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_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the group */ if(NULL == (grp = H5G__open_name(&loc, name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") @@ -311,8 +298,6 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ @@ -329,7 +314,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -341,21 +325,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ if(H5G__link(cur_loc_id, cur_name, type, H5L_SAME_LOC, new_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink() */ @@ -372,7 +350,6 @@ herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -384,21 +361,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to create link */ if(H5G__link(cur_loc_id, cur_name, type, new_loc_id, new_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink2() */ @@ -484,27 +455,20 @@ done: herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(src_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ if(H5G__move(src_loc_id, src_name, H5L_SAME_LOC, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove() */ @@ -520,7 +484,6 @@ herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -530,21 +493,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(dst_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(dst_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call common routine to move the link */ if(H5G__move(src_loc_id, src_name, dst_loc_id, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove2() */ @@ -614,7 +571,6 @@ herr_t H5Gunlink(hid_t loc_id, const char *name) { 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) @@ -626,21 +582,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__unlink(&loc, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gunlink() */ @@ -688,7 +638,6 @@ herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { 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) @@ -700,21 +649,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_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__get_linkval(&loc, name, size, buf) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_linkval() */ @@ -772,7 +715,6 @@ herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { 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) @@ -783,21 +725,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_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if(H5G__set_comment(&loc, name, comment) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gset_comment() */ @@ -860,7 +796,6 @@ int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { H5G_loc_t loc; /* Group's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -873,21 +808,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(bufsize > 0 && !buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine */ if((ret_value = H5G__get_comment(&loc, name, buf, bufsize)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_comment() */ @@ -955,7 +884,6 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, H5G_link_iterate_t lnk_op; /* Link operator */ hsize_t last_obj; /* Index of last object looked at */ hsize_t idx; /* Internal location to hold index */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -977,11 +905,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ lnk_op.op_type = H5G_LINK_OP_OLD; lnk_op.op_func.op_old = op; -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call private function. */ if((ret_value = H5G__iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") @@ -991,8 +914,6 @@ api_ctx_pushed = TRUE; *idx_p = (int)last_obj; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Giterate() */ @@ -1051,7 +972,6 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { H5G_loc_t loc; /* Location of object */ H5G_info_t grp_info; /* Group information */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1063,11 +983,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!num_objs) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "bad pointer to # of objects") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call the internal routine */ if(H5G__get_num_objs(loc.oloc, &grp_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") @@ -1076,8 +991,6 @@ api_ctx_pushed = TRUE; *num_objs = grp_info.nlinks; done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_num_objs() */ @@ -1142,7 +1055,6 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { 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) @@ -1154,18 +1066,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get info */ if(H5G__get_objinfo(&loc, name, follow_link, statbuf) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "cannot stat object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objinfo() */ @@ -1346,7 +1251,6 @@ ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; FUNC_ENTER_API(FAIL) @@ -1356,18 +1260,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") -/* 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 function */ if((ret_value = H5G__get_objname_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object name") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objname_by_idx() */ @@ -1430,7 +1327,6 @@ H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; FUNC_ENTER_API(H5G_UNKNOWN) @@ -1440,18 +1336,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal function*/ if(H5G_UNKNOWN == (ret_value = H5G__obj_get_type_by_idx(loc.oloc, idx))) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object type") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objtype_by_idx() */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index eaee737..f2f3e3a 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -96,7 +96,7 @@ H5G__is_empty_test(hid_t gid) H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -105,10 +105,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* "New format" checks */ @@ -185,8 +185,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_empty_test() */ @@ -216,7 +216,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -225,10 +225,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has any link messages */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) @@ -253,8 +253,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_links_test() */ @@ -283,7 +283,7 @@ H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -292,10 +292,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has a symbol table message */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) @@ -310,8 +310,8 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_stab_test() */ @@ -342,7 +342,7 @@ H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -351,10 +351,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Check if the group has a symbol table message */ if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) @@ -386,8 +386,8 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_new_dense_test() */ @@ -421,7 +421,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -430,10 +430,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Set metadata tag in API context */ H5_BEGIN_TAG(grp->oloc.addr); @@ -478,8 +478,8 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__new_dense_info_test() */ @@ -509,7 +509,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -518,10 +518,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Make certain the group has a symbol table message */ if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) @@ -532,8 +532,8 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__lheap_size_test() */ @@ -566,7 +566,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign { void *obj_ptr; /* Pointer to object for ID */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -579,10 +579,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (obj_ptr = H5I_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { @@ -640,8 +640,8 @@ api_ctx_pushed = TRUE; } /* end else */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__user_path_test() */ @@ -1201,7 +1201,6 @@ done: int H5Idec_ref(hid_t id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1210,18 +1209,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments */ if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ @@ -2025,7 +2018,6 @@ ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2035,18 +2027,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ 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_ATOM, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal routine to retrieve object's name */ if((ret_value = H5I__get_name(&loc, name, size)) < 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_API(ret_value) } /* end H5Iget_name() */ diff --git a/src/H5Itest.c b/src/H5Itest.c index 87aa7b9..426c026 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -79,7 +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 */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -88,18 +88,18 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ 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; + /* 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)) < 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") + 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() */ @@ -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() */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 73ca17c..7c32309 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -340,7 +340,6 @@ H5Lcreate_external(const char *file_name, const char *obj_name, size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -375,13 +374,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ p += file_name_len; HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ -/* 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 an external link */ if(H5L__create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id) < 0) @@ -391,8 +386,6 @@ done: H5MM_xfree(ext_link_buf); H5MM_xfree(norm_obj_name); -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_external() */ @@ -100,7 +100,6 @@ hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -112,21 +111,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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ if((ret_value = H5O__open_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ @@ -159,7 +152,6 @@ H5Oopen_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; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -175,21 +167,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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "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_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ if((ret_value = H5O__open_by_idx(&loc, group_name, idx_type, order, n)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -233,7 +219,6 @@ hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { H5G_loc_t loc; /* Location within file */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) @@ -245,18 +230,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no address supplied") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open the object */ if((ret_value = H5O__open_by_addr(&loc, addr)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ @@ -288,7 +266,6 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, { H5G_loc_t new_loc; /* Location of group to link from */ H5G_loc_t obj_loc; /* Location of object to link to */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -311,21 +288,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_OHDR, 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, obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, 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, obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Create a link to the object */ if(H5O__create_link(&new_loc, new_name, &obj_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Olink() */ @@ -354,7 +325,6 @@ herr_t H5Oincr_refcount(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -364,21 +334,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(object_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ if(H5O__link(oloc, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5O_incr_refcount() */ @@ -407,7 +371,6 @@ herr_t H5Odecr_refcount(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -417,21 +380,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(object_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Change the object's refcount */ if(H5O__link(oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Odecr_refcount() */ @@ -453,7 +410,6 @@ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location info */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -465,21 +421,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_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Check if the object exists */ if((ret_value = H5O__exists_by_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ @@ -501,7 +451,6 @@ herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -513,18 +462,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the object's information */ if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info() */ @@ -546,7 +488,6 @@ herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -560,21 +501,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ if(H5O__get_info_by_name(&loc, name, oinfo/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_name() */ @@ -598,7 +533,6 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -617,21 +551,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx() */ @@ -657,7 +585,6 @@ herr_t H5Oset_comment(hid_t obj_id, const char *comment) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -667,21 +594,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* (Re)set the object's comment */ if(H5O__set_comment_by_name(&loc, ".", comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment() */ @@ -708,7 +629,6 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -720,21 +640,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_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* (Re)set the object's comment */ if(H5O__set_comment_by_name(&loc, name, comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment_by_name() */ @@ -759,7 +673,6 @@ ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) { 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) @@ -769,18 +682,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the object's comment */ if((ret_value = H5O__get_comment_by_name(&loc, ".", comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ @@ -806,7 +712,6 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf 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) @@ -818,21 +723,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_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's comment */ if((ret_value = H5O__get_comment_by_name(&loc, name, comment/*out*/, bufsize)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object: '%s'", name) done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ @@ -873,7 +772,6 @@ herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -887,18 +785,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_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Call internal object visitation routine */ if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit() */ @@ -939,7 +830,6 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_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) @@ -956,21 +846,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_OHDR, 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_OHDR, 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_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal object visitation routine */ if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit_by_name() */ @@ -996,7 +880,6 @@ if(api_ctx_pushed && H5CX_pop() < 0) herr_t H5Oclose(hid_t object_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1009,10 +892,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ case H5I_DATASET: if(H5I_object(object_id) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; if(H5I_dec_app_ref(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") break; @@ -1036,8 +915,6 @@ api_ctx_pushed = TRUE; } /* end switch */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oclose() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 3ca5540..b5a3bdf 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -208,7 +208,6 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t loc; /* Source group group location */ H5G_loc_t dst_loc; /* Destination group location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -225,21 +224,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(src_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") /* Call internal routine to copy object */ if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ocopy() */ diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 31ef9b9..65cb2ae 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -73,27 +73,20 @@ static herr_t H5O__refresh(hid_t obj_id); herr_t H5Oflush(hid_t obj_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", obj_id); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if(H5O__flush(obj_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oflush() */ @@ -242,27 +235,20 @@ done: herr_t H5Orefresh(hid_t oid) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", oid); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(oid, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(oid, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal routine */ if(H5O__refresh(oid) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Orefresh() */ diff --git a/src/H5Otest.c b/src/H5Otest.c index c978d10..32b31f2 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -98,7 +98,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -107,10 +107,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -137,8 +137,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_dense_test() */ @@ -171,7 +171,7 @@ H5O_is_attr_empty_test(hid_t oid) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -180,10 +180,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -238,8 +238,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_empty_test() */ @@ -272,7 +272,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t obj_nattrs; /* Number of attributes */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -281,10 +281,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -336,8 +336,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_num_attrs_test() */ @@ -372,7 +372,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -381,10 +381,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Set metadata tag in API context */ H5_BEGIN_TAG(loc->addr); @@ -439,8 +439,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_attr_dense_info_test() */ @@ -642,7 +642,7 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *idx_msg; /* Pointer to message */ unsigned idx; /* Index of message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -651,10 +651,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -677,8 +677,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ @@ -710,7 +710,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *curr_msg; /* Pointer to current message */ unsigned idx; /* Index of message */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -719,10 +719,10 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; + /* Set API context */ + if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") + api_ctx_pushed = TRUE; /* Get the object header */ if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) @@ -785,8 +785,8 @@ api_ctx_pushed = TRUE; done: if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") + if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ @@ -97,7 +97,6 @@ hid_t H5Pcopy(hid_t id) { void *obj; /* Property object to copy */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value=FALSE; /* return value */ FUNC_ENTER_API(FAIL) @@ -111,10 +110,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); if(NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { @@ -137,8 +132,6 @@ api_ctx_pushed = TRUE; } /* end else */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pcopy() */ @@ -1509,7 +1502,6 @@ done: herr_t H5Pclose(hid_t plist_id) { -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1520,10 +1512,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Check arguments. */ if(H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Close the property list */ if(H5I_dec_app_ref(plist_id) < 0) @@ -1531,8 +1519,6 @@ api_ctx_pushed = TRUE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pclose() */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 2629aa7..e2c92cd 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -3185,7 +3185,6 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value to modify */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3194,10 +3193,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get the current fill value */ if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) @@ -3254,8 +3249,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pset_fill_value() */ @@ -3375,7 +3368,6 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5T_t *type; /* Datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3390,18 +3382,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Get the fill value */ if(H5P_get_fill_value(plist, type, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pget_fill_value() */ @@ -93,7 +93,6 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t { H5G_loc_t loc; /* File location */ H5S_t *space = NULL; /* Pointer to dataspace containing region */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -115,21 +114,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Create reference */ if((ret_value = H5R__create(ref, &loc, name, ref_type, space)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rcreate() */ @@ -166,7 +159,6 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -182,13 +174,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; -/* Verify access property list and set up collective metadata if appropriate */ -if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) - HGOTO_ERROR(H5E_REFERENCE, 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(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -198,8 +186,6 @@ if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference2() */ @@ -232,7 +218,6 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object's group location */ H5S_t *space = NULL; /* Dataspace object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -246,11 +231,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the dataspace with the correct region selected */ if(NULL == (space = H5R__get_region(loc.oloc->file, ref))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve dataspace") @@ -260,8 +240,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_region() */ @@ -294,7 +272,6 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) { H5G_loc_t loc; /* Object location */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -308,18 +285,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the object information */ if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type2() */ @@ -363,7 +333,6 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, { H5G_loc_t loc; /* Group location */ H5F_t *file; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -377,11 +346,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -390,8 +354,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_name() */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index ccb4798..2f41f7d 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -104,7 +104,6 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object location */ H5O_type_t obj_type; /* Object type */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; /* Return value */ FUNC_ENTER_API(H5G_UNKNOWN) @@ -118,11 +117,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the object information */ if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, &obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") @@ -131,8 +125,6 @@ api_ctx_pushed = TRUE; ret_value = H5G_map_obj_type(obj_type); done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ @@ -158,7 +150,6 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -172,11 +163,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Get the file pointer from the entry */ file = loc.oloc->file; @@ -185,8 +171,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID, "unable dereference object") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference1() */ @@ -1744,7 +1744,6 @@ herr_t H5Tclose(hid_t type_id) { H5T_t *dt; /* Pointer to datatype to close */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1755,18 +1754,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_IMMUTABLE == dt->shared->state) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* When the reference count reaches zero the resources are freed */ if(H5I_dec_app_ref(type_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tclose() */ @@ -2526,7 +2519,6 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_t *src; /*source data type descriptor */ H5T_t *dst; /*destination data type desc */ H5T_conv_func_t conv_func; /* Conversion function wrapper */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) @@ -2543,10 +2535,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; /* Set up conversion function wrapper */ conv_func.is_app = TRUE; @@ -2557,8 +2545,6 @@ api_ctx_pushed = TRUE; HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tregister() */ @@ -2688,7 +2674,6 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func) { H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2699,17 +2684,11 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type") if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; if(H5T__unregister(pers, name, src, dst, func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tunregister() */ @@ -2833,7 +2812,6 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, { H5T_path_t *tpath; /* type conversion info */ H5T_t *src, *dst; /* unatomized types */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2848,12 +2826,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set DXPL for operation */ -H5CX_set_dxpl(dxpl_id); + + /* Set DXPL for operation */ + H5CX_set_dxpl(dxpl_id); /* Find the conversion function */ if(NULL == (tpath = H5T_path_find(src, dst))) @@ -2863,8 +2838,6 @@ H5CX_set_dxpl(dxpl_id); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tconvert() */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 91a0f1c..12492fd 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -103,7 +103,6 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -131,21 +130,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit2() */ @@ -254,7 +247,6 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) { H5G_loc_t loc; /* Group location for location */ H5T_t *type = NULL; /* Datatype created */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -273,21 +265,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ if(H5T__commit_anon(loc.oloc->file, type, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit_anon() */ @@ -568,7 +554,6 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) { H5T_t *type = NULL; /* Datatype opened in file */ H5G_loc_t loc; /* Group location of object to open */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -580,13 +565,9 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, 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(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Open it */ if(NULL == (type = H5T__open_name(&loc, name))) @@ -602,8 +583,6 @@ done: if(type != NULL) (void)H5T_close(type); -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen2() */ @@ -632,7 +611,6 @@ H5Tget_create_plist(hid_t dtype_id) { H5T_t *type; /* Datatype object for ID */ herr_t status; /* Generic status value */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -647,20 +625,12 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed") /* Retrieve further information, if the datatype is committed */ - if(status > 0) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - + if(status > 0) /* Retrieve datatype creation properties */ if((ret_value = H5T__get_create_plist(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") - } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_create_plist() */ @@ -681,7 +651,6 @@ herr_t H5Tflush(hid_t type_id) { H5T_t *dt; /* Datatype for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -693,21 +662,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5T_is_named(dt)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(type_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Flush metadata for named datatype */ if(H5T__flush(dt, type_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Tflush */ @@ -728,7 +691,6 @@ herr_t H5Trefresh(hid_t type_id) { H5T_t *dt; /* Datatype for this operation */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -740,21 +702,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!H5T_is_named(dt)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(type_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Call private function to refresh datatype object */ if((H5T__refresh(dt, type_id)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Trefresh */ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 3daf365..feece57 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -214,7 +214,6 @@ H5Tget_member_type(hid_t type_id, unsigned membno) { H5T_t *dt; /* Datatype to query */ H5T_t *memb_dt = NULL; /* Member datatype */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -226,11 +225,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(membno >= dt->shared->u.compnd.nmembs) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Retrieve the datatype for the member */ if(NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type") @@ -243,8 +237,6 @@ done: if(ret_value < 0) if(memb_dt && H5T_close(memb_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_member_type() */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 5a273f5..e4224f5 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -102,7 +102,6 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -116,21 +115,15 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; -/* Set up collective metadata if appropriate */ -if(H5CX_set_loc(loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Set up collective metadata if appropriate */ + if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the datatype to the file, using default property list values */ if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit1() */ @@ -156,7 +149,6 @@ H5Topen1(hid_t loc_id, const char *name) { H5T_t *type = NULL; H5G_loc_t loc; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_API(H5I_INVALID_HID) @@ -168,11 +160,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; - /* Open it */ if(NULL == (type = H5T__open_name(&loc, name))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") @@ -186,8 +173,6 @@ done: if(ret_value < 0) if(type && H5T_close(type) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 546b487..c9ad01a 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -78,7 +78,6 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) H5T_t *dt; /* Datatype to create native datatype from */ H5T_t *new_dt = NULL; /* Datatype for native datatype created */ size_t comp_size = 0; /* Compound datatype's size */ -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) @@ -90,10 +89,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ if(direction != H5T_DIR_DEFAULT && direction != H5T_DIR_ASCEND && direction != H5T_DIR_DESCEND) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not valid direction value") -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") -api_ctx_pushed = TRUE; /* Get the native type */ if(NULL == (new_dt = H5T__get_native_type(dt, direction, NULL, NULL, &comp_size))) @@ -108,8 +103,6 @@ done: if(ret_value < 0) if(new_dt && H5T_close_real(new_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_native_type() */ @@ -581,7 +581,6 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ H5Z_object_t *object = (H5Z_object_t *)key; -hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC @@ -593,11 +592,6 @@ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Do a global flush if the file is opened for write */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { -/* Set API context */ -if(H5CX_push() < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set API context") -api_ctx_pushed = TRUE; - /* When parallel HDF5 is defined, check for collective metadata reads on this * file and set the flag for metadata I/O in the API context. -QAK, 2018/02/14 */ @@ -636,15 +630,9 @@ api_ctx_pushed = TRUE; /* Call the flush routine for mounted file hierarchies */ if(H5F_flush_mounts((H5F_t *)obj_ptr) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") - -if(api_ctx_pushed && H5CX_pop() < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") -api_ctx_pushed = FALSE; } /* end if */ done: -if(api_ctx_pushed && H5CX_pop() < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__flush_file_cb() */ |