diff options
Diffstat (limited to 'src')
-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 |
5 files changed, 47 insertions, 65 deletions
@@ -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 |