diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-09-24 19:23:41 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-09-24 19:23:41 (GMT) |
commit | a56b4db4ae25d30e6e7eb96f27d7b91e35148591 (patch) | |
tree | 7738d08a9734103fd12242eb5ff0244dd74c214d /src/H5Oattribute.c | |
parent | 37309c1bd98b3d810f09569c72ac375e75117a91 (diff) | |
download | hdf5-a56b4db4ae25d30e6e7eb96f27d7b91e35148591.zip hdf5-a56b4db4ae25d30e6e7eb96f27d7b91e35148591.tar.gz hdf5-a56b4db4ae25d30e6e7eb96f27d7b91e35148591.tar.bz2 |
Remainder of vol_normalization changes (dataset, attribute, files, objects).
Diffstat (limited to 'src/H5Oattribute.c')
-rw-r--r-- | src/H5Oattribute.c | 322 |
1 files changed, 166 insertions, 156 deletions
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 640d1c7..5183026 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -13,11 +13,9 @@ /*------------------------------------------------------------------------- * - * Created: H5Oattribute.c - * Dec 11 2006 - * Quincey Koziol <koziol@hdfgroup.org> + * Created: H5Oattribute.c * - * Purpose: Object header attribute routines. + * Purpose: Object header attribute routines. * *------------------------------------------------------------------------- */ @@ -26,21 +24,21 @@ /* Module Setup */ /****************/ -#define H5A_FRIEND /*suppress error about including H5Apkg */ +#define H5A_FRIEND /* Suppress error about including H5Apkg.h */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Apkg.h" /* Attributes */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Fprivate.h" /* File */ +#include "H5private.h" /* Generic Functions */ +#include "H5Apkg.h" /* Attributes */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Fprivate.h" /* File */ /****************/ @@ -129,8 +127,24 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, +static herr_t H5O__attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata); +static htri_t H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open); +static herr_t H5O__attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, + unsigned H5_ATTR_UNUSED *oh_modified, void *_udata); +static herr_t H5O__attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr); +static herr_t H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata); +static herr_t H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata); +static herr_t H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata); +static herr_t H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo); +static herr_t H5O__attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata); +static herr_t H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg, + unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata); /*********************/ /* Package Variables */ @@ -149,12 +163,12 @@ static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, /*------------------------------------------------------------------------- - * Function: H5O_attr_to_dense_cb + * Function: H5O__attr_to_dense_cb * - * Purpose: Object header iterator callback routine to convert compact + * Purpose: Object header iterator callback routine to convert compact * attributes to dense attributes * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -163,14 +177,14 @@ static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, *------------------------------------------------------------------------- */ static herr_t -H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_cvt_t *udata = (H5O_iter_cvt_t *)_udata; /* Operator user data */ H5A_t *attr = (H5A_t *)mesg->native; /* Pointer to attribute to insert */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -186,7 +200,7 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Convert message into a null message in the header */ /* (don't delete attribute's space in the file though) */ - if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) + if(H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -194,15 +208,15 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_to_dense_cb() */ +} /* end H5O__attr_to_dense_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_create + * Function: H5O__attr_create * - * Purpose: Create a new attribute in the object header. + * Purpose: Create a new attribute in the object header. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Friday, December 8, 2006 @@ -283,7 +297,7 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Iterate over existing attributes, moving them to dense storage */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_to_dense_cb; + op.u.lib_op = H5O__attr_to_dense_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "error converting attributes to dense storage") } /* end if */ @@ -337,7 +351,8 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) /* Increment reference count for shared attribute object for the * object handle created by the caller function H5A__create. The count * for the cached object header has been incremented in the step above - * (in H5O__msg_append_real). The dense storage doesn't need a count. */ + * (in H5O__msg_append_real). The dense storage doesn't need a count. + */ attr->shared->nrefs += 1; /* Was new attribute shared? */ @@ -392,12 +407,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_cb + * Function: H5O__attr_open_cb * - * Purpose: Object header iterator callback routine to open an + * Purpose: Object header iterator callback routine to open an * attribute stored compactly. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -406,13 +421,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5O__attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_opn_t *udata = (H5O_iter_opn_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -437,15 +452,15 @@ H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_open_cb() */ +} /* end H5O__attr_open_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_open_by_name + * Function: H5O__attr_open_by_name * - * Purpose: Open an existing attribute in an object header. + * Purpose: Open an existing attribute in an object header. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 11, 2006 @@ -470,7 +485,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) /* Protect the object header to iterate over */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -483,7 +498,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) /* If found the attribute is already opened, make a copy of it to share the * object information. If not, open attribute as a new object */ - if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, name)) < 0) + if((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") else if(found_open_attr == TRUE) { if(NULL == (opened_attr = H5A__copy(NULL, exist_attr))) @@ -506,7 +521,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) /* Iterate over attributes, to locate correct one to open */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_open_cb; + op.u.lib_op = H5O__attr_open_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute") @@ -541,12 +556,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_by_idx_cb + * Function: H5O__attr_open_by_idx_cb * - * Purpose: Callback routine opening an attribute by index + * Purpose: Callback routine opening an attribute by index * - * Return: Success: Non-negative - * Failure: Negative + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -555,12 +569,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) +H5O__attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) { H5A_t **ret_attr = (H5A_t **)_ret_attr; /* 'User data' passed in */ herr_t ret_value = H5_ITER_STOP; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check arguments */ HDassert(attr); @@ -572,16 +586,16 @@ H5O_attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_open_by_idx_cb() */ +} /* end H5O__attr_open_by_idx_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_open_by_idx + * Function: H5O__attr_open_by_idx * - * Purpose: Open an existing attribute in an object header according to + * Purpose: Open an existing attribute in an object header according to * an index. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 18, 2006 @@ -605,7 +619,7 @@ H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Build attribute operator info */ attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5O_attr_open_by_idx_cb; + attr_op.u.lib_op = H5O__attr_open_by_idx_cb; /* Iterate over attributes to locate correct one */ if(H5O_attr_iterate_real((hid_t)-1, loc, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) @@ -615,7 +629,7 @@ H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, * and make a copy of the already opened object to share the object info. */ if(opened_attr) { - if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, opened_attr->shared->name)) < 0) + if((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, opened_attr->shared->name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") /* If found that the attribute is already opened, make a copy of it @@ -647,12 +661,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_find_opened_attr + * Function: H5O__attr_find_opened_attr * - * Purpose: Find out whether an attribute has been opened by giving + * Purpose: Find out whether an attribute has been opened by giving * the name. Return the pointer to the object if found. * - * Return: TRUE: found the already opened object + * Return: TRUE: found the already opened object * FALSE: didn't find the opened object * FAIL: function failed. * @@ -662,14 +676,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open) +H5O__attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open) { hid_t *attr_id_list = NULL; /* List of IDs for opened attributes */ unsigned long loc_fnum; /* File serial # for object */ size_t num_open_attr; /* Number of opened attributes */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get file serial number for the location of attribute */ if(H5F_get_fileno(loc->file, &loc_fnum) < 0) @@ -691,8 +705,8 @@ H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_t /* Retrieve the IDs of all opened attributes */ if(H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE, &check_num_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get IDs of opened attributes") - if(check_num_attr != num_open_attr) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "open attribute count mismatch") + if(check_num_attr != num_open_attr) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "open attribute count mismatch") /* Iterate over the attributes */ for(u = 0; u < num_open_attr; u++) { @@ -724,15 +738,15 @@ done: H5MM_free(attr_id_list); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_find_opened_attr */ +} /* end H5O__attr_find_opened_attr() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_update_shared + * Function: H5O__attr_update_shared * - * Purpose: Update a shared attribute. + * Purpose: Update a shared attribute. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -802,25 +816,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_write_cb + * Function: H5O__attr_write_cb * - * Purpose: Object header iterator callback routine to update an + * Purpose: Object header iterator callback routine to update an * attribute stored compactly. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org * Dec 4 2006 * - * Modification:Raymond Lu - * 4 June 2008 - * Took out the data copying part because the attribute data - * is shared between attribute handle and object header. *------------------------------------------------------------------------- */ static herr_t -H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ @@ -828,7 +838,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -885,15 +895,15 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_write_cb() */ +} /* end H5O__attr_write_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_write + * Function: H5O__attr_write * - * Purpose: Write a new value to an attribute. + * Purpose: Write a new value to an attribute. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 4, 2006 @@ -915,7 +925,7 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) /* Pin the object header */ if(NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -942,7 +952,7 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) /* Iterate over attributes, to locate correct one to update */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_write_cb; + op.u.lib_op = H5O__attr_write_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") @@ -964,12 +974,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_rename_chk_cb + * Function: H5O__attr_rename_chk_cb * - * Purpose: Object header iterator callback routine to check for + * Purpose: Object header iterator callback routine to check for * duplicate name during rename * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -978,13 +988,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(oh); @@ -1001,21 +1011,21 @@ H5O_attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_rename_chk_cb() */ +} /* end H5O__attr_rename_chk_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_rename_mod_cb + * Function: H5O__attr_rename_mod_cb * - * Purpose: Object header iterator callback routine to change name of + * Purpose: Object header iterator callback routine to change name of * attribute during rename * - * Note: This routine doesn't currently allow an attribute to change + * Note: This routine doesn't currently allow an attribute to change * its "shared" status, if the name change would cause a size * difference that would put it into a different category. * Something for later... * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1024,7 +1034,7 @@ H5O_attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, *------------------------------------------------------------------------- */ static herr_t -H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ @@ -1032,7 +1042,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -1096,7 +1106,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* (doesn't decrement the link count on shared components because * the "native" pointer has been reset) */ - if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) + if(H5O__release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release previous attribute") *oh_modified = H5O_MODIFY_CONDENSE; @@ -1130,15 +1140,15 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_rename_mod_cb() */ +} /* end H5O__attr_rename_mod_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_rename + * Function: H5O__attr_rename * - * Purpose: Rename an attribute. + * Purpose: Rename an attribute. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Tuesday, December 5, 2006 @@ -1162,7 +1172,7 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, /* Pin the object header */ if(NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -1190,7 +1200,7 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, /* Iterate over attributes, to check if "new name" exists already */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_rename_chk_cb; + op.u.lib_op = H5O__attr_rename_chk_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") @@ -1200,7 +1210,7 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, /* Iterate over attributes again, to actually rename attribute with old name */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_rename_mod_cb; + op.u.lib_op = H5O__attr_rename_mod_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") @@ -1218,15 +1228,15 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") FUNC_LEAVE_NOAPI_TAG(ret_value) -} /* end H5O__attr_rename */ +} /* end H5O__attr_rename() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_iterate_real + * Function: H5O_attr_iterate_real * - * Purpose: Internal routine to iterate over attributes for an object. + * Purpose: Internal routine to iterate over attributes for an object. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Tuesday, December 5, 2006 @@ -1309,11 +1319,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O__attr_iterate + * Function: H5O__attr_iterate * - * Purpose: Iterate over attributes for an object. + * Purpose: Iterate over attributes for an object. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Tuesday, December 5, 2006 @@ -1322,8 +1332,7 @@ done: */ herr_t H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, - hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, - void *op_data) + hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) { H5G_loc_t loc; /* Object location */ herr_t ret_value = FAIL; /* Return value */ @@ -1347,11 +1356,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_remove_update + * Function: H5O__attr_remove_update * - * Purpose: Check for reverting from dense to compact attribute storage + * Purpose: Check for reverting from dense to compact attribute storage * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Wednesday, February 14, 2007 @@ -1367,12 +1376,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) +H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) { H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(loc); @@ -1427,7 +1436,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Insert attribute message into object header (Will increment reference count on shared attributes) */ /* Find out whether the attribute has been opened */ - if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, (atable.attrs[u])->shared->name)) < 0) + if((found_open_attr = H5O__attr_find_opened_attr(loc, &exist_attr, (atable.attrs[u])->shared->name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "failed in finding opened attribute") /* If found the attribute is already opened, use the opened message to insert. @@ -1450,7 +1459,8 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) /* Update the message after removing the attribute */ /* This is particularly needed when removing the last attribute that is - accessed via fractal heap/v2 B-tree (HDFFV-9277) */ + * accessed via fractal heap/v2 B-tree (HDFFV-9277) + */ if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") @@ -1468,16 +1478,16 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_remove_update() */ +} /* end H5O__attr_remove_update() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_remove_cb + * Function: H5O__attr_remove_cb * - * Purpose: Object header iterator callback routine to remove an + * Purpose: Object header iterator callback routine to remove an * attribute stored compactly. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1486,13 +1496,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -1502,7 +1512,7 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Check for correct attribute message to modify */ if(HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Convert message into a null message (i.e. delete it) */ - if(H5O_release_mesg(udata->f, oh, mesg, TRUE) < 0) + if(H5O__release_mesg(udata->f, oh, mesg, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -1517,15 +1527,15 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_remove_cb() */ +} /* end H5O__attr_remove_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_remove + * Function: H5O__attr_remove * - * Purpose: Delete an attribute on an object. + * Purpose: Delete an attribute on an object. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 11, 2006 @@ -1548,7 +1558,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) /* Pin the object header */ if(NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -1575,7 +1585,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_remove_cb; + op.u.lib_op = H5O__attr_remove_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") @@ -1586,7 +1596,7 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) + if(H5O__attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ @@ -1602,12 +1612,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5O__attr_remove_by_idx + * Function: H5O__attr_remove_by_idx * - * Purpose: Delete an attribute on an object, according to an order within - * an index. + * Purpose: Delete an attribute on an object, according to an order within + * an index. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Wednesday, February 14, 2007 @@ -1631,7 +1641,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Pin the object header */ if(NULL == (oh = H5O_pin(loc))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -1666,7 +1676,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_remove_cb; + op.u.lib_op = H5O__attr_remove_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") @@ -1677,7 +1687,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) + if(H5O__attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ @@ -1695,11 +1705,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_count_real + * Function: H5O__attr_count_real * - * Purpose: Determine the # of attributes on an object + * Purpose: Determine the # of attributes on an object * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Thursday, March 9, 2007 @@ -1707,11 +1717,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) +H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(oh->cache_info.addr) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* Check arguments */ HDassert(f); @@ -1745,16 +1755,16 @@ H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) done: FUNC_LEAVE_NOAPI_TAG(ret_value) -} /* end H5O_attr_count_real */ +} /* end H5O__attr_count_real */ /*------------------------------------------------------------------------- - * Function: H5O_attr_exists_cb + * Function: H5O__attr_exists_cb * - * Purpose: Object header iterator callback routine to check for an + * Purpose: Object header iterator callback routine to check for an * attribute stored compactly, by name. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -1763,13 +1773,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, +H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, unsigned H5_ATTR_UNUSED sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -1785,15 +1795,15 @@ H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_exists_cb() */ +} /* end H5O__attr_exists_cb() */ /*------------------------------------------------------------------------- - * Function: H5O__attr_exists + * Function: H5O__attr_exists * - * Purpose: Determine if an attribute with a particular name exists on an object + * Purpose: Determine if an attribute with a particular name exists on an object * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 11, 2006 @@ -1815,7 +1825,7 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name) /* Protect the object header to iterate over */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; @@ -1842,7 +1852,7 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name) /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5O_attr_exists_cb; + op.u.lib_op = H5O__attr_exists_cb; if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") @@ -1863,7 +1873,7 @@ done: * * Purpose: For 1.8 attribute, returns storage amount for btree and fractal heap * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Vailin Choi * June 19, 2007 @@ -1943,11 +1953,11 @@ done: #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5O__attr_count + * Function: H5O__attr_count * - * Purpose: Determine the # of attributes on an object + * Purpose: Determine the # of attributes on an object * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * * Programmer: Quincey Koziol * Monday, December 11, 2006 @@ -1968,10 +1978,10 @@ H5O__attr_count(const H5O_loc_t *loc) /* Protect the object header to iterate over */ if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve # of attributes on object */ - if(H5O_attr_count_real(loc->file, oh, &nattrs) < 0) + if(H5O__attr_count_real(loc->file, oh, &nattrs) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Set return value */ |