summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c246
1 files changed, 48 insertions, 198 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 1b42106..513d4fe 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -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() */