diff options
-rw-r--r-- | c++/src/H5Object.cpp | 4 | ||||
-rw-r--r-- | fortran/src/H5Af.c | 6 | ||||
-rw-r--r-- | hl/src/H5DS.c | 4 | ||||
-rw-r--r-- | hl/src/H5IM.c | 11 | ||||
-rw-r--r-- | hl/src/H5LT.c | 14 | ||||
-rw-r--r-- | src/H5A.c | 50 | ||||
-rw-r--r-- | src/H5Adeprec.c | 42 | ||||
-rw-r--r-- | src/H5Apublic.h | 4 | ||||
-rw-r--r-- | src/H5vers.txt | 1 | ||||
-rw-r--r-- | src/H5version.h | 15 | ||||
-rw-r--r-- | test/gen_mergemsg.c | 6 | ||||
-rw-r--r-- | test/tattr.c | 103 | ||||
-rw-r--r-- | test/tmisc.c | 16 |
13 files changed, 125 insertions, 151 deletions
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index b3a404c..28e231b 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -250,9 +250,9 @@ int H5Object::getNumAttrs() const //-------------------------------------------------------------------------- void H5Object::removeAttr( const char* name ) const { - herr_t ret_value = H5Adelete2(id, ".", name, H5P_DEFAULT); + herr_t ret_value = H5Adelete(id, name); if( ret_value < 0 ) - throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete2 failed"); + throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed"); } //-------------------------------------------------------------------------- diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index cc4f932..73cb5cf 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -813,7 +813,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5adelete_c - * Purpose: Call H5Adelete2 to delete an attribute + * Purpose: Call H5Adelete to delete an attribute * Inputs: obj_id - object identifier * name - name of the attribute * namelen - name length @@ -835,9 +835,9 @@ nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) HGOTO_DONE(FAIL); /* - * Call H5Adelete2 function. + * Call H5Adelete function. */ - if(H5Adelete2((hid_t)*obj_id, ".", c_name, H5P_DEFAULT) < 0) + if(H5Adelete((hid_t)*obj_id, c_name) < 0) HGOTO_DONE(FAIL); done: diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 7b59c18..a29d8ae 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -485,7 +485,7 @@ herr_t H5DSattach_scale(hid_t did, */ /* the attribute must be deleted, in order to the new one can reflect the changes*/ - if (H5Adelete2(dsid, ".", REFERENCE_LIST, H5P_DEFAULT) < 0) + if(H5Adelete(dsid, REFERENCE_LIST) < 0) goto out; /* store the IDX information (index of the dataset that has the DS) */ @@ -835,7 +835,7 @@ herr_t H5DSdetach_scale(hid_t did, */ /* the attribute must be deleted, in order to the new one can reflect the changes*/ - if (H5Adelete2(dsid, ".", REFERENCE_LIST, H5P_DEFAULT) < 0) + if(H5Adelete(dsid, REFERENCE_LIST) < 0) goto out; /* don't do anything for an empty array */ diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index fa5f87d..ac90cf2 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -597,7 +597,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* The attribute must be deleted, in order to the new one can reflect the changes*/ - if(H5Adelete2(image_id, ".", "PALETTE", H5P_DEFAULT) < 0) + if(H5Adelete(image_id, "PALETTE") < 0) goto out; /* Create a new reference for this palette. */ @@ -719,24 +719,23 @@ herr_t H5IMunlink_palette( hid_t loc_id, /* Check if it is really a reference */ if(attr_class == H5T_REFERENCE) { - /* Delete the attribute */ - if(H5Adelete2(image_id, ".", "PALETTE", H5P_DEFAULT) < 0) + if(H5Adelete(image_id, "PALETTE") < 0) goto out; } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0) + if(H5Tclose(attr_type) < 0) goto out; /* Close the attribute. */ - if ( H5Aclose( attr_id ) < 0) + if(H5Aclose(attr_id) < 0) goto out; } /* ok_pal */ /* Close the image dataset. */ - if ( H5Dclose( image_id ) < 0) + if(H5Dclose(image_id) < 0) return -1; return 0; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index d794912..d47fad1 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -883,7 +883,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id, /* The attribute already exists, delete it */ if(has_attr == 1) - if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0) + if(H5Adelete(obj_id, attr_name) < 0) goto out; /* Create and write the attribute */ @@ -961,7 +961,7 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id, /* The attribute already exists, delete it */ if(has_attr == 1) - if(H5Adelete2(obj_id, ".", attr_name, H5P_DEFAULT) < 0) + if(H5Adelete(obj_id, attr_name) < 0) goto out; /* Create the attribute. */ @@ -2837,22 +2837,20 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, has_attr = H5LT_find_attribute(dset_id,name); /* the attribute already exists, delete it */ - if ( has_attr == 1 ) - { - if(H5Adelete2(dset_id, ".", name, H5P_DEFAULT) < 0) + if(has_attr == 1) + if(H5Adelete(dset_id, name) < 0) return FAIL; - } /*------------------------------------------------------------------------- * create the attribute type *------------------------------------------------------------------------- */ - if ((tid = H5Tcopy(H5T_C_S1)) < 0) + if((tid = H5Tcopy(H5T_C_S1)) < 0) return FAIL; size = strlen(buf) + 1; /* extra null term */ - if (H5Tset_size(tid,(size_t)size) < 0) + if(H5Tset_size(tid,(size_t)size) < 0) goto out; if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0) @@ -2020,11 +2020,51 @@ done: /*-------------------------------------------------------------------------- NAME - H5Adelete2 + H5Adelete PURPOSE Deletes an attribute from a location USAGE - herr_t H5Adelete2(loc_id, obj_name, attr_name, lapl_id) + herr_t H5Adelete(loc_id, name) + hid_t loc_id; IN: Object (dataset or group) to have attribute deleted from + const char *name; IN: Name of attribute to delete + RETURNS + Non-negative on success/Negative on failure + DESCRIPTION + This function removes the named attribute from a dataset or group. +--------------------------------------------------------------------------*/ +herr_t +H5Adelete(hid_t loc_id, const char *name) +{ + H5G_loc_t loc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(H5Adelete, FAIL) + H5TRACE2("e", "i*s", loc_id, name); + + /* check arguments */ + if(H5I_ATTR == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + + /* Delete the attribute from the location */ + if(H5O_attr_remove(loc.oloc, name, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Adelete() */ + + +/*-------------------------------------------------------------------------- + NAME + H5Adelete_by_name + PURPOSE + Deletes an attribute from a location + USAGE + herr_t H5Adelete_by_name(loc_id, obj_name, attr_name, lapl_id) hid_t loc_id; IN: Base location for object const char *obj_name; IN: Name of object relative to location const char *attr_name; IN: Name of attribute to delete @@ -2035,7 +2075,7 @@ done: This function removes the named attribute from an object. --------------------------------------------------------------------------*/ herr_t -H5Adelete2(hid_t loc_id, const char *obj_name, const char *attr_name, +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 */ @@ -2045,7 +2085,7 @@ H5Adelete2(hid_t loc_id, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Adelete2, FAIL) + FUNC_ENTER_API(H5Adelete_by_name, FAIL) H5TRACE4("e", "i*s*si", loc_id, obj_name, attr_name, lapl_id); /* check arguments */ @@ -2083,7 +2123,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") FUNC_LEAVE_API(ret_value) -} /* H5Adelete2() */ +} /* H5Adelete_by_name() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index af3b7f9..9f888c8 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -413,47 +413,5 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) done: FUNC_LEAVE_API(ret_value) } /* H5Aiterate1() */ - - -/*-------------------------------------------------------------------------- - NAME - H5Adelete1 - PURPOSE - Deletes an attribute from a location - USAGE - herr_t H5Adelete1(loc_id, name) - hid_t loc_id; IN: Object (dataset or group) to have attribute deleted from - const char *name; IN: Name of attribute to delete - RETURNS - Non-negative on success/Negative on failure - DESCRIPTION - This function removes the named attribute from a dataset or group. - NOTE - Deprecated in favor of H5Adelete2 ---------------------------------------------------------------------------*/ -herr_t -H5Adelete1(hid_t loc_id, const char *name) -{ - H5G_loc_t loc; /* Object location */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_API(H5Adelete1, FAIL) - H5TRACE2("e", "i*s", loc_id, name); - - /* check arguments */ - if(H5I_ATTR == H5I_get_type(loc_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - - /* Delete the attribute from the location */ - if(H5O_attr_remove(loc.oloc, name, H5AC_dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Adelete1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Apublic.h b/src/H5Apublic.h index 97c067e..c320a91 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -76,7 +76,8 @@ H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_DLL herr_t H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapd_id); -H5_DLL herr_t H5Adelete2(hid_t loc_id, const char *obj_name, +H5_DLL herr_t H5Adelete(hid_t loc_id, const char *name); +H5_DLL herr_t H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id); H5_DLL herr_t 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); @@ -103,7 +104,6 @@ H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, H5_DLL hid_t H5Aopen_name(hid_t loc_id, const char *name); H5_DLL hid_t H5Aopen_idx(hid_t loc_id, unsigned idx); H5_DLL int H5Aget_num_attrs(hid_t loc_id); -H5_DLL herr_t H5Adelete1(hid_t loc_id, const char *name); H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data); diff --git a/src/H5vers.txt b/src/H5vers.txt index aa85e7e..00ab84b 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -46,7 +46,6 @@ # (although not required, it's easier to compare this file with the headers # generated if the list below is in alphanumeric sort order - QAK) FUNCTION: H5Acreate; ; v10, v18 -FUNCTION: H5Adelete; ; v10, v18 FUNCTION: H5Aiterate; H5A_operator; v10, v18 FUNCTION: H5Dcreate; ; v10, v18 FUNCTION: H5Dopen; ; v10, v18 diff --git a/src/H5version.h b/src/H5version.h index 208dfa0..eab972c 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -42,10 +42,6 @@ #define H5Acreate_vers 1 #endif /* !defined(H5Acreate_vers) */ -#if !defined(H5Adelete_vers) -#define H5Adelete_vers 1 -#endif /* !defined(H5Adelete_vers) */ - #if !defined(H5Aiterate_vers) #define H5Aiterate_vers 1 #endif /* !defined(H5Aiterate_vers) */ @@ -158,17 +154,6 @@ #error "H5Acreate_vers set to invalid value" #endif /* H5Acreate_vers */ -#if !defined(H5Adelete_vers) || H5Adelete_vers == 2 -#ifndef H5Adelete_vers -#define H5Adelete_vers 2 -#endif /* H5Adelete_vers */ -#define H5Adelete H5Adelete2 -#elif H5Adelete_vers == 1 -#define H5Adelete H5Adelete1 -#else /* H5Adelete_vers */ -#error "H5Adelete_vers set to invalid value" -#endif /* H5Adelete_vers */ - #if !defined(H5Aiterate_vers) || H5Aiterate_vers == 2 #ifndef H5Aiterate_vers #define H5Aiterate_vers 2 diff --git a/test/gen_mergemsg.c b/test/gen_mergemsg.c index c4bb9e8..5df5674 100644 --- a/test/gen_mergemsg.c +++ b/test/gen_mergemsg.c @@ -158,7 +158,7 @@ int main() assert(gid > 0); /* Delete 2nd attribute */ - ret = H5Adelete2(gid, ".", ATTR2, H5P_DEFAULT); + ret = H5Adelete(gid, ATTR2); assert(ret >= 0); /* Close first group */ @@ -225,7 +225,7 @@ int main() assert(gid > 0); /* Delete 3rd attribute */ - ret = H5Adelete2(gid, ".", ATTR3, H5P_DEFAULT); + ret = H5Adelete(gid, ATTR3); assert(ret >= 0); /* Create dataspace for 3rd attribute */ @@ -272,7 +272,7 @@ int main() assert(gid > 0); /* Delete 2nd attribute */ - ret = H5Adelete2(gid, ".", ATTR2, H5P_DEFAULT); + ret = H5Adelete(gid, ATTR2); assert(ret >= 0); /* Close first group */ diff --git a/test/tattr.c b/test/tattr.c index 201989a..c01c9ce 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1512,8 +1512,8 @@ test_attr_delete(hid_t fapl) VERIFY(oinfo.num_attrs, 3, "H5Oget_info"); /* Try to delete bogus attribute */ - ret = H5Adelete2(dataset, ".", "Bogus", H5P_DEFAULT); - VERIFY(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, "Bogus"); + VERIFY(ret, FAIL, "H5Adelete"); /* Verify the correct number of attributes */ ret = H5Oget_info(dataset, ".", &oinfo, H5P_DEFAULT); @@ -1521,8 +1521,8 @@ test_attr_delete(hid_t fapl) VERIFY(oinfo.num_attrs, 3, "H5Oget_info"); /* Delete middle (2nd) attribute */ - ret = H5Adelete2(dataset, ".", ATTR2_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, ATTR2_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Verify the correct number of attributes */ ret = H5Oget_info(dataset, ".", &oinfo, H5P_DEFAULT); @@ -1558,8 +1558,8 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Delete first attribute */ - ret = H5Adelete2(dataset, ".", ATTR1_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, ATTR1_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Verify the correct number of attributes */ ret = H5Oget_info(dataset, ".", &oinfo, H5P_DEFAULT); @@ -1581,8 +1581,8 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Delete first attribute */ - ret = H5Adelete2(dataset, ".", ATTR3_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, ATTR3_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Verify the correct number of attributes */ ret = H5Oget_info(dataset, ".", &oinfo, H5P_DEFAULT); @@ -1681,13 +1681,13 @@ test_attr_dtype_shared(hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Delete attribute */ - ret = H5Adelete2(dset_id, ".", ATTR1_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dset_id, ATTR1_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Check reference count on named datatype */ ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info"); - VERIFY(oinfo.rc, 2, "H5Adelete2"); + VERIFY(oinfo.rc, 2, "H5Adelete"); /* Create attribute on dataset */ attr_id = H5Acreate2(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); @@ -2238,8 +2238,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) for(u--; u >= min_dense; u--) { /* Delete attribute */ sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Verify attributes still left */ ret = test_attr_dense_verify(dataset, u); @@ -2252,8 +2252,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Delete one more attribute, which should cause reversion to compact storage */ sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_dense = H5O_is_attr_dense_test(dataset); @@ -2265,8 +2265,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) /* Delete another attribute, to verify deletion in compact storage */ sprintf(attrname, "attr %02u", (u - 1)); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_dense = H5O_is_attr_dense_test(dataset); @@ -2705,8 +2705,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Delete second attribute, attributes should still be stored densely */ /* Delete attribute */ - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_dense = H5O_is_attr_dense_test(dataset); @@ -2718,8 +2718,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_dense = H5O_is_attr_dense_test(dataset); @@ -2926,8 +2926,8 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 1; sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_empty = H5O_is_attr_empty_test(dataset); @@ -2941,8 +2941,8 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 3; sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_empty = H5O_is_attr_empty_test(dataset); @@ -2956,8 +2956,8 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 2; sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_empty = H5O_is_attr_empty_test(dataset); @@ -2971,8 +2971,8 @@ test_attr_big(hid_t fcpl, hid_t fapl) /* Delete attribute */ u = 0; sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Check on dataset's attribute storage status */ is_empty = H5O_is_attr_empty_test(dataset); @@ -3323,11 +3323,6 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); - /* Delete attribute */ - ret = H5Adelete1(dataset, "attr"); - CHECK(ret, FAIL, "H5Adelete1"); - - /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -4041,8 +4036,8 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(gid, FAIL, "H5Gopen2"); /* Delete attribute */ - ret = H5Adelete2(gid, ".", "attr-003", H5P_DEFAULT); - CHECK(aid, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, "attr-003"); + CHECK(aid, FAIL, "H5Adelete"); /* Create some additional attributes */ aid = H5Acreate2(gid, "attr-008", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); @@ -4266,8 +4261,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Verify state of object */ ret = H5O_num_attrs_test(my_dataset, &nattrs); @@ -4286,8 +4281,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete another attribute, to push attribute storage into compact form */ sprintf(attrname, "attr %02u", (min_dense - 1)); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Verify state of object */ ret = H5O_num_attrs_test(my_dataset, &nattrs); @@ -4390,8 +4385,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete several attributes from object, until attribute storage resumes compact form */ for(u = max_compact; u >= min_dense; u--) { sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Verify state of object */ ret = H5O_num_attrs_test(my_dataset, &nattrs); @@ -4410,8 +4405,8 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete another attribute, to push attribute storage into compact form */ sprintf(attrname, "attr %02u", (min_dense - 1)); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); /* Verify state of object */ ret = H5O_num_attrs_test(my_dataset, &nattrs); @@ -4455,12 +4450,12 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) /* Delete all attributes */ for(u = max_compact; u > 0; u--) { sprintf(attrname, "attr %02u", u); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); } /* end for */ sprintf(attrname, "attr %02u", 0); - ret = H5Adelete2(my_dataset, ".", attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(my_dataset, attrname); + CHECK(ret, FAIL, "H5Adelete"); } /* end for */ /* Close Datasets */ @@ -8197,8 +8192,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) sprintf(attrname, "attr %02u", u); /* Delete second dataset's attribute */ - ret = H5Adelete2(fid, DSET2_NAME, attrname, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete_by_name(fid, DSET2_NAME, attrname, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Adelete_by_name"); /* Check refcount on attributes now */ @@ -8761,8 +8756,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(gid, FAIL, "H5Gopen2"); /* Delete first attribute */ - ret = H5Adelete2(gid, ".", ATTR7_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, ATTR7_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Re-create first attribute */ aid = H5Acreate2(gid, ATTR7_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); @@ -8772,8 +8767,8 @@ test_attr_bug1(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Delete second attribute */ - ret = H5Adelete2(gid, ".", ATTR8_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, ATTR8_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Re-create second attribute */ aid = H5Acreate2(gid, ATTR8_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); diff --git a/test/tmisc.c b/test/tmisc.c index abe32ff..08cf7ef 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -4365,8 +4365,8 @@ test_misc25a(void) CHECK(gid, FAIL, "H5Gopen2"); /* Delete 2nd attribute */ - ret = H5Adelete2(gid, ".", MISC25A_ATTR2_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, MISC25A_ATTR2_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Close first group */ ret = H5Gclose(gid); @@ -4431,8 +4431,8 @@ test_misc25a(void) CHECK(gid, FAIL, "H5Gopen2"); /* Delete 3rd attribute */ - ret = H5Adelete2(gid, ".", MISC25A_ATTR3_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, MISC25A_ATTR3_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Create dataspace for 3rd attribute */ sid = H5Screate(H5S_SCALAR); @@ -4478,8 +4478,8 @@ test_misc25a(void) CHECK(gid, FAIL, "H5Gopen2"); /* Delete 2nd attribute */ - ret = H5Adelete2(gid, ".", MISC25A_ATTR2_NAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, MISC25A_ATTR2_NAME); + CHECK(ret, FAIL, "H5Adelete"); /* Close first group */ ret = H5Gclose(gid); @@ -4698,8 +4698,8 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Lmove"); /* Delete the first attribute */ - ret = H5Adelete2(gid, ".", MISC25C_ATTRNAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Adelete2"); + ret = H5Adelete(gid, MISC25C_ATTRNAME); + CHECK(ret, FAIL, "H5Adelete"); /* Close the dataset group */ ret = H5Gclose(gid); |