diff options
Diffstat (limited to 'src')
61 files changed, 558 insertions, 518 deletions
@@ -176,7 +176,7 @@ H5A_term_interface(void) if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_ATTR))>0) { - (void)H5I_clear_type(H5I_ATTR, FALSE); + (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); } else { (void)H5I_dec_type_ref(H5I_ATTR); H5_interface_initialize_g = 0; @@ -494,7 +494,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create attribute in object header") /* Register the new attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") /* Now it's safe to say it's uninitialized */ @@ -556,7 +556,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize attribute") /* Register the attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: @@ -621,7 +621,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Register the attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: @@ -692,7 +692,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") /* Register the attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: @@ -991,8 +991,8 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) /* Check for type conversion required */ if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL))) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL))) < 0) + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Get the maximum buffer size needed and allocate it */ @@ -1039,9 +1039,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) done: /* Release resources */ if(src_id >= 0) - (void)H5I_dec_ref(src_id); + (void)H5I_dec_ref(src_id, FALSE); if(dst_id >= 0) - (void)H5I_dec_ref(dst_id); + (void)H5I_dec_ref(dst_id, FALSE); if(tconv_buf && !tconv_owned) H5FL_BLK_FREE(attr_buf, tconv_buf); if(bkg_buf) @@ -1151,8 +1151,8 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) /* Check for type conversion required */ if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL))) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL))) < 0) + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Get the maximum buffer size needed and allocate it */ @@ -1183,9 +1183,9 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) done: /* Release resources */ if(src_id >= 0) - (void)H5I_dec_ref(src_id); + (void)H5I_dec_ref(src_id, FALSE); if(dst_id >= 0) - (void)H5I_dec_ref(dst_id); + (void)H5I_dec_ref(dst_id, FALSE); if(tconv_buf) H5FL_BLK_FREE(attr_buf, tconv_buf); if(bkg_buf) @@ -1230,7 +1230,7 @@ H5Aget_space(hid_t attr_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to copy dataspace") /* Atomize */ - if((ret_value = H5I_register(H5I_DATASPACE, ds)) < 0) + if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") done: @@ -1288,7 +1288,7 @@ H5Aget_type(hid_t attr_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") /* Atomize */ - if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") done: @@ -1339,7 +1339,7 @@ H5Aget_create_plist(hid_t attr_id) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get default ACPL") /* Create the property list object to return */ - if((new_plist_id = H5P_copy_plist(plist)) < 0) + if((new_plist_id = H5P_copy_plist(plist, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy attribute creation properties") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_plist_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get property list") @@ -2033,7 +2033,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, loc_found = TRUE; /* Open the object */ - if((obj_loc_id = H5O_open_by_loc(&obj_loc, H5AC_ind_dxpl_id)) < 0) + if((obj_loc_id = H5O_open_by_loc(&obj_loc, H5AC_ind_dxpl_id, TRUE)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Build attribute operator info */ @@ -2052,7 +2052,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Release resources */ if(obj_loc_id > 0) { - if(H5I_dec_ref(obj_loc_id) < 0) + if(H5I_dec_ref(obj_loc_id, TRUE) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "unable to close temporary object") } /* end if */ else if(loc_found && H5G_loc_free(&obj_loc) < 0) @@ -2276,7 +2276,7 @@ H5Aclose(hid_t attr_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") /* Decrement references to that atom (and close it) */ - if(H5I_dec_ref(attr_id) < 0) + if(H5I_dec_ref(attr_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute") done: @@ -260,7 +260,7 @@ H5AC_init_interface(void) HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list class") /* Get an ID for the blocking, collective H5AC dxpl */ - if ((H5AC_dxpl_id=H5P_create_id(xfer_pclass)) < 0) + if ((H5AC_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") /* Get the property list object */ @@ -282,7 +282,7 @@ H5AC_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") /* Get an ID for the non-blocking, collective H5AC dxpl */ - if ((H5AC_noblock_dxpl_id=H5P_create_id(xfer_pclass)) < 0) + if ((H5AC_noblock_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") /* Get the property list object */ @@ -304,7 +304,7 @@ H5AC_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") /* Get an ID for the non-blocking, independent H5AC dxpl */ - if ((H5AC_ind_dxpl_id=H5P_create_id(xfer_pclass)) < 0) + if ((H5AC_ind_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") /* Get the property list object */ @@ -374,9 +374,9 @@ H5AC_term_interface(void) n = 1; /* H5I */ /* Close H5AC dxpl */ - if (H5I_dec_ref(H5AC_dxpl_id) < 0 || - H5I_dec_ref(H5AC_noblock_dxpl_id) < 0 || - H5I_dec_ref(H5AC_ind_dxpl_id) < 0) + if (H5I_dec_ref(H5AC_dxpl_id, FALSE) < 0 || + H5I_dec_ref(H5AC_noblock_dxpl_id, FALSE) < 0 || + H5I_dec_ref(H5AC_ind_dxpl_id, FALSE) < 0) H5E_clear_stack(NULL); /*ignore error*/ else { /* Reset static IDs */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 85cef2f..77f5736 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -214,7 +214,7 @@ H5Aopen_name(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Register the attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: @@ -270,7 +270,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") /* Register the attribute and get an ID for it */ - if((ret_value = H5I_register(H5I_ATTR, attr)) < 0) + if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: @@ -169,7 +169,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (dset = H5D_create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") done: @@ -253,7 +253,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") done: @@ -332,7 +332,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open dataset") /* Register an atom for the dataset */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't register dataset atom") done: @@ -382,7 +382,7 @@ H5Dclose(hid_t dset_id) * Decrement the counter on the dataset. It will be freed if the count * reaches zero. */ - if(H5I_dec_ref(dset_id) < 0) + if(H5I_dec_ref(dset_id, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't free") done: @@ -425,7 +425,7 @@ H5Dget_space(hid_t dset_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get data space") /* Create an atom */ - if((ret_value = H5I_register (H5I_DATASPACE, space)) < 0) + if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space") done: @@ -520,7 +520,7 @@ H5Dget_type(hid_t dset_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") /* Create an atom */ - if((ret_value=H5I_register (H5I_DATATYPE, copied_type)) < 0) + if((ret_value=H5I_register (H5I_DATATYPE, copied_type, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: @@ -571,7 +571,7 @@ H5Dget_create_plist(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") /* Copy the creation property list */ - if((new_dcpl_id = H5P_copy_plist(dcpl_plist)) < 0) + if((new_dcpl_id = H5P_copy_plist(dcpl_plist, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to copy the creation property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -603,35 +603,35 @@ H5Dget_create_plist(hid_t dset_id) size_t bkg_size; /* Size of background buffer */ /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT)); + dst_id = H5I_register(H5I_DATATYPE, H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT), FALSE); if(dst_id < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype") - src_id = H5I_register(H5I_DATATYPE, H5T_copy(dset->shared->type, H5T_COPY_ALL)); + src_id = H5I_register(H5I_DATATYPE, H5T_copy(dset->shared->type, H5T_COPY_ALL), FALSE); if(src_id < 0) { - H5I_dec_ref(dst_id); + H5I_dec_ref(dst_id, FALSE); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype") } /* end if */ /* Allocate a background buffer */ bkg_size = MAX(H5T_get_size(copied_fill.type), H5T_get_size(dset->shared->type)); if(H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ /* Convert fill value */ if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf, H5AC_ind_dxpl_id) < 0) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); if(bkg_buf) (void)H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end if */ /* Release local resources */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); if(bkg_buf) (void)H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ @@ -647,7 +647,7 @@ H5Dget_create_plist(hid_t dset_id) done: if(ret_value < 0) if(new_dcpl_id > 0) - (void)H5I_dec_ref(new_dcpl_id); + (void)H5I_dec_ref(new_dcpl_id, TRUE); FUNC_LEAVE_API(ret_value) } /* end H5Dget_create_plist() */ @@ -931,7 +931,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") /* Change to the custom memory allocation routines for reading VL data */ - if((vlen_bufsize.xfer_pid=H5P_create_id(pclass)) < 0) + if((vlen_bufsize.xfer_pid=H5P_create_id(pclass, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available") /* Get the property list struct */ @@ -954,11 +954,11 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, done: if(vlen_bufsize.fspace_id > 0) { - if(H5I_dec_ref(vlen_bufsize.fspace_id) < 0) + if(H5I_dec_ref(vlen_bufsize.fspace_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ if(vlen_bufsize.mspace_id > 0) { - if(H5I_dec_ref(vlen_bufsize.mspace_id) < 0) + if(H5I_dec_ref(vlen_bufsize.mspace_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ if(vlen_bufsize.fl_tbuf != NULL) @@ -966,7 +966,7 @@ done: if(vlen_bufsize.vl_tbuf != NULL) (void)H5FL_BLK_FREE(vlen_vl_buf, vlen_bufsize.vl_tbuf); if(vlen_bufsize.xfer_pid > 0) { - if(H5I_dec_ref(vlen_bufsize.xfer_pid) < 0) + if(H5I_dec_ref(vlen_bufsize.xfer_pid, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list") } /* end if */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d15715b..977957c 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -520,7 +520,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info } /* end if */ else { /* Create temporary datatypes for selection iteration */ - if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) + if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") /* Spaces might not be the same shape, iterate over the file selection directly */ @@ -559,7 +559,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info /* Create temporary datatypes for selection iteration */ if(f_tid < 0) { - if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL))) < 0) + if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") } /* end if */ @@ -617,7 +617,7 @@ done: HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") } /* end if */ if(f_tid!=(-1)) { - if(H5I_dec_ref(f_tid) < 0) + if(H5I_dec_ref(f_tid, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") } /* end if */ if(file_space_normalized) { @@ -4016,7 +4016,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, copy_setup_done = TRUE; /* Create datatype ID for src datatype */ - if((tid_src = H5I_register(H5I_DATATYPE, dt_src)) < 0) + if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") /* If there's a VLEN source datatype, set up type conversion information */ @@ -4032,7 +4032,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, /* create a memory copy of the variable-length datatype */ if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") - if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem)) < 0) + if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") /* create variable-length datatype at the destinaton file */ @@ -4040,7 +4040,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") - if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst)) < 0) + if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") /* Set up the conversion functions */ @@ -4070,7 +4070,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Atomize */ - if((sid_buf = H5I_register(H5I_DATASPACE, buf_space)) < 0) { + if((sid_buf = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ @@ -4145,16 +4145,16 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, done: if(sid_buf > 0) - if(H5I_dec_ref(sid_buf) < 0) + if(H5I_dec_ref(sid_buf, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary dataspace ID") if(tid_src > 0) - if(H5I_dec_ref(tid_src) < 0) + if(H5I_dec_ref(tid_src, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_dst > 0) - if(H5I_dec_ref(tid_dst) < 0) + if(H5I_dec_ref(tid_dst, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_mem > 0) - if(H5I_dec_ref(tid_mem) < 0) + if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) H5MM_xfree(buf); diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 0458e74..add58e6 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -341,7 +341,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, HDassert(dt_src); /* Create datatype ID for src datatype, so it gets freed */ - if((tid_src = H5I_register(H5I_DATATYPE, dt_src)) < 0) + if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") /* If there's a VLEN source datatype, do type conversion information */ @@ -360,7 +360,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, /* create a memory copy of the variable-length datatype */ if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") - if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem)) < 0) + if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") /* create variable-length datatype at the destinaton file */ @@ -368,7 +368,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") - if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst)) < 0) + if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") /* Set up the conversion functions */ @@ -402,7 +402,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Atomize */ - if((buf_sid = H5I_register(H5I_DATASPACE, buf_space)) < 0) { + if((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ @@ -464,16 +464,16 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, done: if(buf_sid > 0) - if(H5I_dec_ref(buf_sid) < 0) + if(H5I_dec_ref(buf_sid, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary dataspace ID") if(tid_src > 0) - if(H5I_dec_ref(tid_src) < 0) + if(H5I_dec_ref(tid_src, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_dst > 0) - if(H5I_dec_ref(tid_dst) < 0) + if(H5I_dec_ref(tid_dst, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_mem > 0) - if(H5I_dec_ref(tid_mem) < 0) + if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) (void)H5FL_BLK_FREE(type_conv, buf); diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 14ad520..a773ba3 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1209,7 +1209,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, /* Create datatype ID for src datatype. We may or may not use this ID, * but this ensures that the src datatype will be freed. */ - if((tid_src = H5I_register(H5I_DATATYPE, dt_src)) < 0) + if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") /* If there's a VLEN source datatype, set up type conversion information */ @@ -1217,7 +1217,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, /* create a memory copy of the variable-length datatype */ if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") - if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem)) < 0) + if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") /* create variable-length datatype at the destinaton file */ @@ -1225,7 +1225,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") - if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst)) < 0) + if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") /* Set up the conversion functions */ @@ -1264,7 +1264,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Atomize */ - if((buf_sid = H5I_register(H5I_DATASPACE, buf_space)) < 0) { + if((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ @@ -1383,16 +1383,16 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, done: if(buf_sid > 0) - if(H5I_dec_ref(buf_sid) < 0) + if(H5I_dec_ref(buf_sid, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary dataspace ID") if(tid_src > 0) - if(H5I_dec_ref(tid_src) < 0) + if(H5I_dec_ref(tid_src, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_dst > 0) - if(H5I_dec_ref(tid_dst) < 0) + if(H5I_dec_ref(tid_dst, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tid_mem > 0) - if(H5I_dec_ref(tid_mem) < 0) + if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(buf) (void)H5FL_BLK_FREE(type_conv, buf); diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index a07c86f..b1f6586 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -170,7 +170,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") done: @@ -242,7 +242,7 @@ H5Dopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open dataset") /* Register an atom for the dataset */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "can't register dataset atom") done: diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 4879f4d..6bc635e 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -229,10 +229,10 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, /* Construct source & destination datatype IDs, if we will need them */ if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL))) < 0) + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") - if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL))) < 0) + if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") } /* end if */ @@ -332,9 +332,9 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, } /* end else */ done: - if(src_id != (-1) && H5I_dec_ref(src_id) < 0) + if(src_id != (-1) && H5I_dec_ref(src_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") - if(dst_id != (-1) && H5I_dec_ref(dst_id) < 0) + if(dst_id != (-1) && H5I_dec_ref(dst_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID") if(tmp_buf) (void)H5FL_BLK_FREE(type_conv, tmp_buf); @@ -402,7 +402,7 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, /* Create temporary datatype for conversion operation */ if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype") - if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type)) < 0) + if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") /* Retrieve sizes of memory & file datatypes */ @@ -673,7 +673,7 @@ H5D_fill_term(H5D_fill_buf_info_t *fb_info) /* Free other resources for vlen fill values */ if(fb_info->has_vlen_fill_type) { if(fb_info->mem_tid > 0) - H5I_dec_ref(fb_info->mem_tid); + H5I_dec_ref(fb_info->mem_tid, FALSE); else if(fb_info->mem_type) H5T_close(fb_info->mem_type); if(fb_info->bkg_buf) diff --git a/src/H5Dint.c b/src/H5Dint.c index 162a14f..4723b17 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -241,7 +241,7 @@ H5D_term_interface(void) * * QAK - 5/13/03 */ - H5I_clear_type(H5I_DATASET, TRUE); + H5I_clear_type(H5I_DATASET, TRUE, FALSE); } else { H5I_dec_type_ref(H5I_DATASET); H5_interface_initialize_g = 0; @@ -535,7 +535,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) * don't bother to copy it, just increment the reference count */ if(!vl_type && creating && dcpl_id == H5P_DATASET_CREATE_DEFAULT) { - if(H5I_inc_ref(dcpl_id) < 0) + if(H5I_inc_ref(dcpl_id, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "Can't increment default DCPL ID") new_dset->dcpl_id = dcpl_id; } /* end if */ @@ -544,7 +544,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") - new_dset->dcpl_id = H5P_copy_plist(plist); + new_dset->dcpl_id = H5P_copy_plist(plist, FALSE); } /* end else */ /* Set return value */ @@ -554,7 +554,7 @@ done: if(ret_value == NULL) if(new_dset != NULL) { if(new_dset->dcpl_id != 0) - (void)H5I_dec_ref(new_dset->dcpl_id); + (void)H5I_dec_ref(new_dset->dcpl_id, FALSE); H5FL_FREE(H5D_shared_t, new_dset); } /* end if */ @@ -618,12 +618,12 @@ H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type)) < 0) + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { - if(H5I_inc_ref(type_id) < 0) + if(H5I_inc_ref(type_id, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, FAIL, "Can't increment datatype ID") /* Use existing datatype */ @@ -1161,7 +1161,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") } /* end if */ if(new_dset->shared->type) { - if(H5I_dec_ref(new_dset->shared->type_id) < 0) + if(H5I_dec_ref(new_dset->shared->type_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") } /* end if */ if(H5F_addr_defined(new_dset->oloc.addr)) { @@ -1173,7 +1173,7 @@ done: } /* end if */ } /* end if */ if(new_dset->shared->dcpl_id != 0) { - if(H5I_dec_ref(new_dset->shared->dcpl_id) < 0) + if(H5I_dec_ref(new_dset->shared->dcpl_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") } /* end if */ H5FL_FREE(H5D_shared_t, new_dset->shared); @@ -1327,7 +1327,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load space info from dataset header") /* Get a datatype ID for the dataset's datatype */ - if((dataset->shared->type_id = H5I_register(H5I_DATATYPE, dataset->shared->type)) < 0) + if((dataset->shared->type_id = H5I_register(H5I_DATATYPE, dataset->shared->type, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") /* Get dataset creation property list object */ @@ -1508,7 +1508,7 @@ done: } /* end if */ if(dataset->shared->type) { if(dataset->shared->type_id > 0) { - if(H5I_dec_ref(dataset->shared->type_id) < 0) + if(H5I_dec_ref(dataset->shared->type_id, FALSE) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ else { @@ -1612,8 +1612,8 @@ H5D_close(H5D_t *dataset) * Release datatype, dataspace and creation property list -- there isn't * much we can do if one of these fails, so we just continue. */ - free_failed = (H5I_dec_ref(dataset->shared->type_id) < 0 || H5S_close(dataset->shared->space) < 0 || - H5I_dec_ref(dataset->shared->dcpl_id) < 0); + free_failed = (H5I_dec_ref(dataset->shared->type_id, FALSE) < 0 || H5S_close(dataset->shared->space) < 0 || + H5I_dec_ref(dataset->shared->dcpl_id, FALSE) < 0); /* Remove the dataset from the list of opened objects in the file */ if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0) diff --git a/src/H5Doh.c b/src/H5Doh.c index e99f9ee..2c3e23f 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -48,7 +48,8 @@ static void *H5O_dset_get_copy_file_udata(void); static void H5O_dset_free_copy_file_udata(void *); static htri_t H5O_dset_isa(H5O_t *loc); -static hid_t H5O_dset_open(const H5G_loc_t *obj_loc, hid_t dxpl_id); +static hid_t H5O_dset_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, + hbool_t app_ref); static void *H5O_dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); static H5O_loc_t *H5O_dset_get_oloc(hid_t obj_id); @@ -219,7 +220,7 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dset_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O_dset_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t app_ref) { H5D_t *dset = NULL; /* Dataset opened */ hid_t ret_value; /* Return value */ @@ -233,7 +234,7 @@ H5O_dset_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an ID for the dataset */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) + if((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataset") done: @@ -230,7 +230,7 @@ H5E_init_interface(void) HDsnprintf(lib_vers, sizeof(lib_vers), "%u.%u.%u%s", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, (HDstrlen(H5_VERS_SUBRELEASE) > 0 ? "-"H5_VERS_SUBRELEASE : "")); if(NULL == (cls = H5E_register_class(H5E_CLS_NAME, H5E_CLS_LIB_NAME, lib_vers))) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "class initialization failed") - if((H5E_ERR_CLS_g = H5I_register(H5I_ERROR_CLASS, cls)) < 0) + if((H5E_ERR_CLS_g = H5I_register(H5I_ERROR_CLASS, cls, FALSE)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error class") /* Include the automatically generated error code initialization */ @@ -275,11 +275,11 @@ H5E_term_interface(void) if(n > 0) { /* Clear any outstanding error stacks */ if(nstk > 0) - H5I_clear_type(H5I_ERROR_STACK, FALSE); + H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); /* Clear all the error classes */ if(ncls > 0) { - H5I_clear_type(H5I_ERROR_CLASS, FALSE); + H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS) == 0) @@ -288,7 +288,7 @@ H5E_term_interface(void) /* Clear all the error messages */ if(nmsg > 0) { - H5I_clear_type(H5I_ERROR_MSG, FALSE); + H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG) == 0) { @@ -390,7 +390,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error class") /* Register the new error class to get an ID for it */ - if((ret_value = H5I_register(H5I_ERROR_CLASS, cls)) < 0) + if((ret_value = H5I_register(H5I_ERROR_CLASS, cls, TRUE)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error class") done: @@ -471,7 +471,7 @@ H5Eunregister_class(hid_t class_id) * Decrement the counter on the dataset. It will be freed if the count * reaches zero. */ - if(H5I_dec_ref(class_id) < 0) + if(H5I_dec_ref(class_id, TRUE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error class") done: @@ -616,8 +616,8 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) /* Close the message if it is in the class being closed */ if(err_msg->cls == cls) - if(H5I_dec_ref(obj_id) < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") + if(H5I_remove(obj_id) < 0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREMOVE, FAIL, "unable to remove error message") done: FUNC_LEAVE_NOAPI(ret_value) @@ -649,7 +649,7 @@ H5Eclose_msg(hid_t err_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error class") /* Decrement the counter. It will be freed if the count reaches zero. */ - if(H5I_dec_ref(err_id) < 0) + if(H5I_dec_ref(err_id, TRUE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") done: @@ -724,7 +724,7 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error message") /* Register the new error class to get an ID for it */ - if((ret_value = H5I_register(H5I_ERROR_MSG, msg)) < 0) + if((ret_value = H5I_register(H5I_ERROR_MSG, msg, TRUE)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") done: @@ -838,7 +838,7 @@ H5Ecreate_stack(void) H5E_set_default_auto(stk); /* Register the stack */ - if((ret_value = H5I_register(H5I_ERROR_STACK, stk)) < 0) + if((ret_value = H5I_register(H5I_ERROR_STACK, stk, TRUE)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't create error stack") done: @@ -874,7 +874,7 @@ H5Eget_current_stack(void) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error stack") /* Register the stack */ - if((ret_value = H5I_register(H5I_ERROR_STACK, stk)) < 0) + if((ret_value = H5I_register(H5I_ERROR_STACK, stk, TRUE)) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't create error stack") done: @@ -922,13 +922,13 @@ H5E_get_current_stack(void) new_error = &(estack_copy->slot[u]); /* Increment the IDs to indicate that they are used in this stack */ - if(H5I_inc_ref(current_error->cls_id) < 0) + if(H5I_inc_ref(current_error->cls_id, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error class") new_error->cls_id = current_error->cls_id; - if(H5I_inc_ref(current_error->maj_num) < 0) + if(H5I_inc_ref(current_error->maj_num, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") new_error->maj_num = current_error->maj_num; - if(H5I_inc_ref(current_error->min_num) < 0) + if(H5I_inc_ref(current_error->min_num, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") new_error->min_num = current_error->min_num; if(NULL == (new_error->func_name = H5MM_xstrdup(current_error->func_name))) @@ -1035,14 +1035,14 @@ H5E_set_current_stack(H5E_t *estack) new_error = &(estack->slot[u]); /* Increment the IDs to indicate that they are used in this stack */ - if(H5I_inc_ref(new_error->cls_id) < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") + if(H5I_inc_ref(new_error->cls_id, FALSE) < 0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class") current_error->cls_id = new_error->cls_id; - if(H5I_inc_ref(new_error->maj_num) < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") + if(H5I_inc_ref(new_error->maj_num, FALSE) < 0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class") current_error->maj_num = new_error->maj_num; - if(H5I_inc_ref(new_error->min_num) < 0) - HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") + if(H5I_inc_ref(new_error->min_num, FALSE) < 0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to increment ref count on error class") current_error->min_num = new_error->min_num; if(NULL == (current_error->func_name = H5MM_xstrdup(new_error->func_name))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -1087,7 +1087,7 @@ H5Eclose_stack(hid_t stack_id) * Decrement the counter on the error stack. It will be freed if the count * reaches zero. */ - if(H5I_dec_ref(stack_id)<0) + if(H5I_dec_ref(stack_id, TRUE)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error stack") } /* end if */ diff --git a/src/H5Einit.h b/src/H5Einit.h index ac02d48..c5ceec4 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -27,152 +27,152 @@ assert(H5E_DATASET_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_DATASET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_FUNC_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Function entry/exit"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FUNC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_STORAGE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data storage"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_STORAGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_FILE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "File accessability"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SOHM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Shared Object Header Messages"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SOHM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SYM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_VFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_VFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_INTERNAL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Internal error (too specific to document in detail)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_INTERNAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BTREE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "B-Tree node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BTREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_REFERENCE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "References"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_REFERENCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_DATASPACE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataspace"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_DATASPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_RESOURCE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Resource unavailable"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_RESOURCE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_PLIST_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Property lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_PLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_LINK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Links"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_LINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_DATATYPE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Datatype"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_DATATYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_RS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Reference Counted Strings"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_RS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_HEAP_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Heap"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_HEAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_OHDR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object header"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_OHDR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ATOM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ATTR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Attribute"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ATTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NONE_MAJOR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_IO_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Low-level I/O"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_IO_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SLIST_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Skip Lists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_EFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "External file list"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_EFL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_TST_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Ternary Search Trees"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_TST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ARGS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Invalid arguments to routine"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ARGS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Error API"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_PLINE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Data filters"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_PLINE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_FSPACE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Free Space Manager"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CACHE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Object cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /*********************/ @@ -184,610 +184,610 @@ if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg))<0) assert(H5E_SEEKERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Seek failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SEEKERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_READERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_READERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_WRITEERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Write failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_WRITEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CLOSEERROR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Close failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CLOSEERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_OVERFLOW_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Address overflowed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_OVERFLOW_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_FCNTL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File control (fcntl) failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FCNTL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Resource errors */ assert(H5E_NOSPACE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "No space available for allocation"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOSPACE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTALLOC_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't allocate space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTALLOC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCOPY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to copy object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCOPY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTFREE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to free object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTFREE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ALREADYEXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ALREADYEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTLOCK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to lock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTUNLOCK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unlock object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTUNLOCK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTGC_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to garbage collect"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTGC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTGETSIZE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to compute size"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTGETSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_OBJOPEN_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object is already open"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_OBJOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Heap errors */ assert(H5E_CANTRESTORE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't restore condition"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESTORE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRESTORE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCOMPUTE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compute value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOMPUTE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCOMPUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTEXTEND_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't extend heap's space"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTEXTEND_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTEXTEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTATTACH_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't attach object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTATTACH_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTATTACH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTUPDATE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't update object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUPDATE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTUPDATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTOPERATE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't operate on object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTOPERATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Function entry/exit interface errors */ assert(H5E_CANTINIT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to initialize object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ALREADYINIT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already initialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ALREADYINIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTRELEASE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to release object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRELEASE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Property list errors */ assert(H5E_CANTGET_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't get value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTGET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSET_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't set value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_DUPCLASS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Free space errors */ assert(H5E_CANTMERGE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't merge objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTMERGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTREVIVE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't revive object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTREVIVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSHRINK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't shrink container"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSHRINK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Object header related errors */ assert(H5E_LINKCOUNT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad object header link count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_LINKCOUNT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_LINKCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_VERSION_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Wrong version number"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_VERSION_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_VERSION_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_ALIGNMENT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Alignment error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_ALIGNMENT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_ALIGNMENT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADMESG_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unrecognized message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADMESG_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADMESG_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTDELETE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't delete message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDELETE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTDELETE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADITER_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Iteration failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADITER_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADITER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTPACK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't pack messages"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPACK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTPACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTRESET_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't reset object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRESET_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* System level errors */ assert(H5E_SYSERRSTR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "System error message"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SYSERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* I/O pipeline errors */ assert(H5E_NOFILTER_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Requested filter is not available"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CALLBACK_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Callback failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CALLBACK_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANAPPLY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'can apply' callback"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANAPPLY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SETLOCAL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Error from filter 'set local' callback"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SETLOCAL_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NOENCODER_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter present but encoding disabled"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOENCODER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTFILTER_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Filter operation failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTFILTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Group related errors */ assert(H5E_CANTOPENOBJ_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTOPENOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCLOSEOBJ_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't close object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCLOSEOBJ_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_COMPLEN_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Name component is too long"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_COMPLEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_PATH_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Problem with path to object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_PATH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* No error */ assert(H5E_NONE_MINOR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* File accessability errors */ assert(H5E_FILEEXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILEEXISTS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FILEEXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_FILEOPEN_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File already open"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_FILEOPEN_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_FILEOPEN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCREATE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create file"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCREATE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCREATE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTOPENFILE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to open file"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTOPENFILE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTOPENFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCLOSEFILE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to close file"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLOSEFILE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCLOSEFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NOTHDF5_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Not an HDF5 file"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTHDF5_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOTHDF5_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADFILE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad file ID accessed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADFILE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADFILE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_TRUNCATED_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File has been truncated"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TRUNCATED_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_TRUNCATED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_MOUNT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File mount error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_MOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Object atom related errors */ assert(H5E_BADATOM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find atom information (already closed?)"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADATOM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADGROUP_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to find ID group information"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADGROUP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTREGISTER_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to register new atom"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTREGISTER_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTINC_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to increment reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTINC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTDEC_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decrement reference count"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTDEC_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NOIDS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of IDs for group"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOIDS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Cache related errors */ assert(H5E_CANTFLUSH_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to flush data from cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTFLUSH_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTFLUSH_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSERIALIZE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to serialize data from cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSERIALIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTLOAD_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to load metadata into cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLOAD_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTLOAD_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_PROTECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Protected metadata error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_PROTECT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_PROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NOTCACHED_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Metadata not currently cached"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTCACHED_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOTCACHED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_SYSTEM_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Internal error detected"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_SYSTEM_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_SYSTEM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTINS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert metadata into cache"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTINS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTRENAME_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to rename metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRENAME_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTPROTECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to protect metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPROTECT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTUNPROTECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to unprotect metadata"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNPROTECT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTUNPROTECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTPIN_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to pin cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTPIN_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTUNPIN_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to un-pin cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTUNPIN_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTUNPIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTMARKDIRTY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark a pinned entry as dirty"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMARKDIRTY_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTMARKDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTDIRTY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to mark metadata as dirty"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDIRTY_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTDIRTY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTEXPUNGE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to expunge a metadata cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTEXPUNGE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTEXPUNGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTRESIZE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entry"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Link related errors */ assert(H5E_TRAVERSE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Link traversal failure"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_TRAVERSE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_TRAVERSE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NLINKS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Too many soft links in path"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NLINKS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NLINKS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_NOTREGISTERED_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Link class not registered"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOTREGISTERED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTMOVE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Move callback returned error"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSORT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't sort objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSORT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Parallel MPI errors */ assert(H5E_MPI_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Some MPI function failed"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MPI_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_MPI_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_MPIERRSTR_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "MPI Error String"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_MPIERRSTR_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_MPIERRSTR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTRECV_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't receive data"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTRECV_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Dataspace errors */ assert(H5E_CANTCLIP_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't clip hyperslab region"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCLIP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCOUNT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't count elements"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCOUNT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSELECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't select hyperslab"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTNEXT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't move to next iterator location"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTNEXT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADSELECT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Invalid selection"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADSELECT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTCOMPARE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't compare objects"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCOMPARE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Argument errors */ assert(H5E_UNINITIALIZED_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Information is uinitialized"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_UNINITIALIZED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_UNSUPPORTED_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Feature is unsupported"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_UNSUPPORTED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADTYPE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Inappropriate type"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADTYPE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADRANGE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Out of range"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADRANGE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADVALUE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADVALUE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* B-tree related errors */ assert(H5E_NOTFOUND_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object not found"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_NOTFOUND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_EXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Object already exists"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_EXISTS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTENCODE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to encode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTENCODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTDECODE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to decode value"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTDECODE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSPLIT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to split node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSPLIT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTREDISTRIBUTE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to redistribute records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTREDISTRIBUTE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTSWAP_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to swap records"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTSWAP_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTINSERT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to insert object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTINSERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTLIST_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to list node"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTLIST_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTMODIFY_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to modify record"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTMODIFY_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_CANTREMOVE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to remove object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTREMOVE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Datatype conversion errors */ assert(H5E_CANTCONVERT_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't convert datatypes"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_CANTCONVERT_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_BADSIZE_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "Bad size for object"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") -if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg))<0) +if((H5E_BADSIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") #endif /* H5Einit_H */ diff --git a/src/H5Eint.c b/src/H5Eint.c index e0fa482..156e5ed 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -722,13 +722,13 @@ H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, if(estack->nused < H5E_NSLOTS) { /* Increment the IDs to indicate that they are used in this stack */ - if(H5I_inc_ref(cls_id) < 0) + if(H5I_inc_ref(cls_id, FALSE) < 0) HGOTO_DONE(FAIL) estack->slot[estack->nused].cls_id = cls_id; - if(H5I_inc_ref(maj_id) < 0) + if(H5I_inc_ref(maj_id, FALSE) < 0) HGOTO_DONE(FAIL) estack->slot[estack->nused].maj_num = maj_id; - if(H5I_inc_ref(min_id) < 0) + if(H5I_inc_ref(min_id, FALSE) < 0) HGOTO_DONE(FAIL) estack->slot[estack->nused].min_num = min_id; if(NULL == (estack->slot[estack->nused].func_name = H5MM_xstrdup(func))) @@ -778,11 +778,11 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) /* Decrement the IDs to indicate that they are no longer used by this stack */ /* (In reverse order that they were incremented, so that reference counts work well) */ - if(H5I_dec_ref(error->min_num) < 0) + if(H5I_dec_ref(error->min_num, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") - if(H5I_dec_ref(error->maj_num) < 0) + if(H5I_dec_ref(error->maj_num, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") - if(H5I_dec_ref(error->cls_id) < 0) + if(H5I_dec_ref(error->cls_id, FALSE) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error class") /* Release strings */ @@ -164,7 +164,7 @@ H5F_term_interface(void) if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_FILE)) != 0) { - H5I_clear_type(H5I_FILE, FALSE); + H5I_clear_type(H5I_FILE, FALSE, FALSE); } else { /* Make certain we've cleaned up all the shared file objects */ H5F_sfile_assert_num(0); @@ -211,7 +211,7 @@ H5Fget_create_plist(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") /* Create the property list object to return */ - if((ret_value = H5P_copy_plist(plist)) < 0) + if((ret_value = H5P_copy_plist(plist, TRUE)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to copy file creation properties") done: @@ -254,7 +254,7 @@ H5Fget_access_plist(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") /* Retrieve the file's access property list */ - if((ret_value = H5F_get_access_plist(f)) < 0) + if((ret_value = H5F_get_access_plist(f, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file access property list") done: @@ -286,7 +286,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5F_get_access_plist(H5F_t *f) +H5F_get_access_plist(H5F_t *f, hbool_t app_ref) { H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ @@ -301,7 +301,7 @@ H5F_get_access_plist(H5F_t *f) /* Make a copy of the default file access property list */ if(NULL == (old_plist = H5I_object(H5P_LST_FILE_ACCESS_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if((ret_value = H5P_copy_plist(old_plist)) < 0) + if((ret_value = H5P_copy_plist(old_plist, app_ref)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list") if(NULL == (new_plist = H5I_object(ret_value))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") @@ -338,7 +338,7 @@ H5F_get_access_plist(H5F_t *f) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't free the old driver information") /* Increment the reference count on the driver ID and insert it into the property list */ - if(H5I_inc_ref(f->shared->lf->driver_id) < 0) + if(H5I_inc_ref(f->shared->lf->driver_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver") if(H5P_set(new_plist, H5F_ACS_FILE_DRV_ID_NAME, &(f->shared->lf->driver_id)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file driver ID") @@ -863,7 +863,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) */ if(NULL == (plist = H5I_object(fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not property list") - f->shared->fcpl_id = H5P_copy_plist(plist); + f->shared->fcpl_id = H5P_copy_plist(plist, FALSE); /* Get the FCPL values to cache */ if(H5P_get(plist, H5F_CRT_ADDR_BYTE_NUM_NAME, &f->shared->sizeof_addr) < 0) @@ -1049,7 +1049,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) if(H5I_GENPROP_LST != H5I_get_type(f->shared->fcpl_id)) /* Push error, but keep going*/ HDONE_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list") - if(H5I_dec_ref(f->shared->fcpl_id) < 0) + if(H5I_dec_ref(f->shared->fcpl_id, FALSE) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close property list") @@ -1481,7 +1481,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") /* Get an atom for the file */ - if((ret_value = H5I_register(H5I_FILE, new_file)) < 0) + if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") /* Keep this ID in file object structure */ @@ -1562,7 +1562,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file") /* Get an atom for the file */ - if((ret_value = H5I_register(H5I_FILE, new_file)) < 0) + if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") /* Keep this ID in file object structure */ @@ -1919,7 +1919,7 @@ H5F_try_close(H5F_t *f) while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs)) != 0) { /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) - if(H5I_dec_ref(objs[u]) < 0) + if(H5I_dec_ref(objs[u], FALSE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object") } /* end while */ @@ -1931,7 +1931,7 @@ H5F_try_close(H5F_t *f) while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATATYPE, (int)(sizeof(objs)/sizeof(objs[0])), objs)) != 0) { /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) - if(H5I_dec_ref(objs[u]) < 0) + if(H5I_dec_ref(objs[u], FALSE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object") } /* end while */ } /* end if */ @@ -2010,7 +2010,7 @@ H5Fclose(hid_t file_id) * Decrement reference count on atom. When it reaches zero the file will * be closed. */ - if(H5I_dec_ref(file_id) < 0) + if(H5I_dec_ref(file_id, TRUE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: @@ -2064,7 +2064,7 @@ H5Freopen(hid_t file_id) /* Duplicate old file's name */ new_file->name = H5MM_xstrdup(old_file->name); - if((ret_value = H5I_register(H5I_FILE, new_file)) < 0) + if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") /* Keep this ID in file object structure */ @@ -2510,7 +2510,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5F_get_id(H5F_t *file) +H5F_get_id(H5F_t *file, hbool_t app_ref) { hid_t ret_value; @@ -2520,11 +2520,11 @@ H5F_get_id(H5F_t *file) if(file->file_id == -1) { /* Get an atom for the file */ - if((file->file_id = H5I_register(H5I_FILE, file)) < 0) + if((file->file_id = H5I_register(H5I_FILE, file, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") } else { /* Increment reference count on atom. */ - if(H5I_inc_ref(file->file_id) < 0) + if(H5I_inc_ref(file->file_id, app_ref) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") } /* end else */ @@ -203,7 +203,7 @@ H5FD_term_interface(void) if(H5_interface_initialize_g) { if((n=H5I_nmembers(H5I_VFL))!=0) { - H5I_clear_type(H5I_VFL, FALSE); + H5I_clear_type(H5I_VFL, FALSE, FALSE); /* Reset the VFL drivers, if they've been closed */ if(H5I_nmembers(H5I_VFL)==0) { @@ -281,7 +281,7 @@ H5FD_free_cls(H5FD_class_t *cls) * Monday, July 26, 1999 * * Modifications: - * Copied guts of function info H5FD_register + * Copied guts of function into H5FD_register * Quincey Koziol * Friday, January 30, 2004 * @@ -312,7 +312,7 @@ H5FDregister(const H5FD_class_t *cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") /* Create the new class ID */ - if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t))) < 0) + if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") done: @@ -348,7 +348,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5FD_register(const void *_cls, size_t size) +H5FD_register(const void *_cls, size_t size, hbool_t app_ref) { hid_t ret_value; const H5FD_class_t *cls=(const H5FD_class_t *)_cls; @@ -372,7 +372,7 @@ H5FD_register(const void *_cls, size_t size) HDmemcpy(saved,cls,size); /* Create the new class ID */ - if((ret_value=H5I_register(H5I_VFL, saved)) < 0) + if((ret_value=H5I_register(H5I_VFL, saved, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") done: @@ -416,7 +416,7 @@ H5FDunregister(hid_t driver_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver") /* The H5FD_class_t struct will be freed by this function */ - if(H5I_dec_ref(driver_id) < 0) + if(H5I_dec_ref(driver_id, TRUE) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to unregister file driver") done: @@ -427,7 +427,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_get_class * - * Purpose: Optains a pointer to the driver struct containing all the + * Purpose: Obtains a pointer to the driver struct containing all the * callback pointers, etc. The PLIST_ID argument can be a file * access property list, a data transfer property list, or a * file driver identifier. @@ -667,7 +667,7 @@ H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl) H5MM_xfree(pl); /* Decrement reference count for driver */ - if(H5I_dec_ref(driver_id) < 0) + if(H5I_dec_ref(driver_id, FALSE) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't decrement reference count for driver") done: @@ -743,7 +743,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) /* Increment the reference count on driver and copy driver info */ - if(H5I_inc_ref(driver_id) < 0) + if(H5I_inc_ref(driver_id, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VFL driver") if(H5FD_fapl_copy(driver_id, driver_info, &copied_driver_info) < 0) HGOTO_ERROR (H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy VFL driver info") @@ -860,7 +860,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) /* Increment the reference count on the driver and copy the driver info */ - if(H5I_inc_ref(driver_id) < 0) + if(H5I_inc_ref(driver_id, FALSE) < 0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINC, FAIL, "can't increment VFL driver ID") if(H5FD_dxpl_copy(driver_id, driver_info, &copied_driver_info) < 0) HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy VFL driver") @@ -1090,7 +1090,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) * driver ID to prevent it from being freed while this file is open. */ file->driver_id = driver_id; - if(H5I_inc_ref(file->driver_id) < 0) + if(H5I_inc_ref(file->driver_id, FALSE) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") file->cls = driver; file->maxaddr = maxaddr; @@ -1209,7 +1209,7 @@ H5FD_close(H5FD_t *file) /* Prepare to close file by clearing all public fields */ driver = file->cls; - if(H5I_dec_ref(file->driver_id) < 0) + if(H5I_dec_ref(file->driver_id, FALSE) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") /* diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 4c468b6..22acf89 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -181,7 +181,7 @@ H5FD_core_init(void) FUNC_ENTER_NOAPI(H5FD_core_init, FAIL) if (H5I_VFL!=H5Iget_type(H5FD_CORE_g)) - H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t)); + H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ ret_value=H5FD_CORE_g; diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index b078511..1d12086 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -255,7 +255,7 @@ H5FD_direct_init(void) FUNC_ENTER_NOAPI(H5FD_direct_init, FAIL) if (H5I_VFL!=H5I_get_type(H5FD_DIRECT_g)) - H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t)); + H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ ret_value=H5FD_DIRECT_g; diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 34360e5..5d9058c 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -189,7 +189,7 @@ H5FD_family_init(void) FUNC_ENTER_NOAPI(H5FD_family_init, FAIL) if (H5I_VFL!=H5Iget_type(H5FD_FAMILY_g)) - H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t)); + H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ ret_value=H5FD_FAMILY_g; @@ -330,7 +330,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/, if (memb_fapl_id) { if(NULL == (plist = H5I_object(fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list") - *memb_fapl_id = H5P_copy_plist(plist); + *memb_fapl_id = H5P_copy_plist(plist, TRUE); } /* end if */ done: @@ -371,7 +371,7 @@ H5FD_family_fapl_get(H5FD_t *_file) fa->memb_size = file->memb_size; if(NULL == (plist = H5I_object(file->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - fa->memb_fapl_id = H5P_copy_plist(plist); + fa->memb_fapl_id = H5P_copy_plist(plist, FALSE); /* Set return value */ ret_value=fa; @@ -419,13 +419,13 @@ H5FD_family_fapl_copy(const void *_old_fa) /* Deep copy the property list objects in the structure */ if(old_fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) { - if(H5I_inc_ref(new_fa->memb_fapl_id)<0) + if(H5I_inc_ref(new_fa->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") } /* end if */ else { if(NULL == (plist = H5I_object(old_fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - new_fa->memb_fapl_id = H5P_copy_plist(plist); + new_fa->memb_fapl_id = H5P_copy_plist(plist, FALSE); } /* end else */ /* Set return value */ @@ -464,7 +464,7 @@ H5FD_family_fapl_free(void *_fa) FUNC_ENTER_NOAPI(H5FD_family_fapl_free, FAIL) - if(H5I_dec_ref(fa->memb_fapl_id)<0) + if(H5I_dec_ref(fa->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") H5MM_xfree(fa); @@ -505,13 +505,13 @@ H5FD_family_dxpl_copy(const void *_old_dx) memcpy(new_dx, old_dx, sizeof(H5FD_family_dxpl_t)); if(old_dx->memb_dxpl_id==H5P_DATASET_XFER_DEFAULT) { - if(H5I_inc_ref(new_dx->memb_dxpl_id)<0) + if(H5I_inc_ref(new_dx->memb_dxpl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") } /* end if */ else { if(NULL == (plist = H5I_object(old_dx->memb_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - new_dx->memb_dxpl_id = H5P_copy_plist(plist); + new_dx->memb_dxpl_id = H5P_copy_plist(plist, FALSE); } /* end else */ /* Set return value */ @@ -550,7 +550,7 @@ H5FD_family_dxpl_free(void *_dx) FUNC_ENTER_NOAPI(H5FD_family_dxpl_free, FAIL) - if(H5I_dec_ref(dx->memb_dxpl_id)<0) + if(H5I_dec_ref(dx->memb_dxpl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") H5MM_xfree(dx); @@ -750,7 +750,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") if (H5P_FILE_ACCESS_DEFAULT==fapl_id) { file->memb_fapl_id = H5P_FILE_ACCESS_DEFAULT; - if(H5I_inc_ref(file->memb_fapl_id)<0) + if(H5I_inc_ref(file->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") file->memb_size = 1024*1024*1024; /*1GB. Actual member size to be updated later */ file->pmem_size = 1024*1024*1024; /*1GB. Member size passed in through property */ @@ -768,14 +768,14 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get new family member size") if(fa->memb_fapl_id==H5P_FILE_ACCESS_DEFAULT) { - if(H5I_inc_ref(fa->memb_fapl_id)<0) + if(H5I_inc_ref(fa->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") file->memb_fapl_id = fa->memb_fapl_id; } /* end if */ else { if(NULL == (plist = H5I_object(fa->memb_fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - file->memb_fapl_id = H5P_copy_plist(plist); + file->memb_fapl_id = H5P_copy_plist(plist, FALSE); } /* end else */ file->memb_size = fa->memb_size; /* Actual member size to be updated later */ file->pmem_size = fa->memb_size; /* Member size passed in through property */ @@ -849,7 +849,7 @@ done: if (file->memb) H5MM_xfree(file->memb); - if(H5I_dec_ref(file->memb_fapl_id)<0) + if(H5I_dec_ref(file->memb_fapl_id, FALSE)<0) HDONE_ERROR(H5E_VFL, H5E_CANTDEC, NULL, "can't close driver ID") if (file->name) H5MM_xfree(file->name); @@ -901,7 +901,7 @@ H5FD_family_close(H5FD_t *_file) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close member files") /* Clean up other stuff */ - if(H5I_dec_ref(file->memb_fapl_id)<0) + if(H5I_dec_ref(file->memb_fapl_id, FALSE)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") if (file->memb) H5MM_xfree(file->memb); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index dee4581..9824511 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -289,7 +289,7 @@ H5FD_log_init(void) FUNC_ENTER_NOAPI(H5FD_log_init, FAIL) if (H5I_VFL!=H5Iget_type(H5FD_LOG_g)) - H5FD_LOG_g = H5FD_register(&H5FD_log_g,sizeof(H5FD_class_t)); + H5FD_LOG_g = H5FD_register(&H5FD_log_g,sizeof(H5FD_class_t),FALSE); /* Set return value */ ret_value=H5FD_LOG_g; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 89a8637..eac3f00 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -201,7 +201,7 @@ H5FD_mpio_init(void) FUNC_ENTER_NOAPI(H5FD_mpio_init, FAIL) if (H5I_VFL!=H5I_get_type(H5FD_MPIO_g)) - H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g,sizeof(H5FD_class_mpi_t)); + H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g,sizeof(H5FD_class_mpi_t),FALSE); #ifdef H5FDmpio_DEBUG if (!H5FD_mpio_Debug_inited) diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 6c30065..9683e27 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -287,7 +287,7 @@ H5FD_mpiposix_init(void) FUNC_ENTER_NOAPI(H5FD_mpiposix_init, FAIL) if (H5I_VFL!=H5Iget_type(H5FD_MPIPOSIX_g)) - H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g,sizeof(H5FD_class_mpi_t)); + H5FD_MPIPOSIX_g = H5FD_register((const H5FD_class_t *)&H5FD_mpiposix_g,sizeof(H5FD_class_mpi_t),FALSE); /* Set return value */ ret_value=H5FD_MPIPOSIX_g; diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 4c8c28e..f4797bb 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -49,7 +49,7 @@ H5_DLL herr_t H5FD_fapl_close(hid_t driver_id, void *fapl); H5_DLL herr_t H5FD_dxpl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info); H5_DLL herr_t H5FD_dxpl_copy(hid_t driver_id, const void *dxpl, void **copied_dxpl); H5_DLL herr_t H5FD_dxpl_close(hid_t driver_id, void *dxpl); -H5_DLL hid_t H5FD_register(const void *cls, size_t size); +H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref); H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index b01ba3f..63b7dc7 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -240,7 +240,7 @@ H5FD_sec2_init(void) FUNC_ENTER_NOAPI(H5FD_sec2_init, FAIL) if(H5I_VFL != H5I_get_type(H5FD_SEC2_g)) - H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t)); + H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), FALSE); /* Set return value */ ret_value = H5FD_SEC2_g; diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c index 08a8e69..3b7e0ed 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -219,7 +219,7 @@ H5FD_windows_init(void) FUNC_ENTER_NOAPI(H5FD_windows_init, FAIL) if(H5I_VFL != H5I_get_type(H5FD_WINDOWS_g)) - H5FD_WINDOWS_g = H5FD_register(&H5FD_windows_g, sizeof(H5FD_class_t)); + H5FD_WINDOWS_g = H5FD_register(&H5FD_windows_g, sizeof(H5FD_class_t), FALSE); /* Set return value */ ret_value = H5FD_WINDOWS_g; diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 432cf12..f91ad82 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -419,11 +419,11 @@ H5_DLL herr_t H5F_try_close(H5F_t *f); /* Functions than retrieve values from the file struct */ H5_DLL hid_t H5F_get_driver_id(const H5F_t *f); -H5_DLL hid_t H5F_get_access_plist(H5F_t *f); +H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); H5_DLL unsigned H5F_get_intent(const H5F_t *f); H5_DLL char *H5F_get_extpath(const H5F_t *f); H5_DLL herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum); -H5_DLL hid_t H5F_get_id(H5F_t *file); +H5_DLL hid_t H5F_get_id(H5F_t *file, hbool_t app_ref); H5_DLL unsigned H5F_get_obj_count(const H5F_t *f, unsigned types); H5_DLL unsigned H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *obj_id_list); H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); @@ -209,7 +209,7 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, /* Create the new group & get its ID */ if(NULL == (grp = H5G_create_named(&loc, name, lcpl_id, gcpl_id, gapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: @@ -340,7 +340,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) /* Create the new group & get its ID */ if(NULL == (grp = H5G_create(loc.oloc->file, gcpl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: @@ -397,7 +397,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the group */ - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: @@ -447,7 +447,7 @@ H5Gget_create_plist(hid_t group_id) /* Copy the default group creation property list */ if(NULL == (gcpl_plist = H5I_object(H5P_LST_GROUP_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") - if((new_gcpl_id = H5P_copy_plist(gcpl_plist)) < 0) + if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") if(NULL == (new_plist = H5I_object(new_gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -492,7 +492,7 @@ H5Gget_create_plist(hid_t group_id) done: if(ret_value < 0) { if(new_gcpl_id > 0) - (void)H5I_dec_ref(new_gcpl_id); + (void)H5I_dec_ref(new_gcpl_id, TRUE); } /* end if */ FUNC_LEAVE_API(ret_value) @@ -702,7 +702,7 @@ H5Gclose(hid_t group_id) * Decrement the counter on the group atom. It will be freed if the count * reaches zero. */ - if(H5I_dec_ref(group_id) < 0) + if(H5I_dec_ref(group_id, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") done: @@ -803,7 +803,7 @@ H5G_term_interface(void) if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_GROUP))) - H5I_clear_type(H5I_GROUP, FALSE); + H5I_clear_type(H5I_GROUP, FALSE, FALSE); else { /* Destroy the group object id group */ H5I_dec_type_ref(H5I_GROUP); @@ -1668,7 +1668,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(NULL == (grp = H5G_open_name(&loc, group_name, lapl_id, dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((gid = H5I_register(H5I_GROUP, grp)) < 0) + if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") /* Set up user data for callback */ @@ -1683,7 +1683,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, done: /* Release the group opened */ if(gid > 0) { - if(H5I_dec_ref(gid) < 0) + if(H5I_dec_ref(gid, TRUE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") } /* end if */ else if(grp && H5G_close(grp) < 0) @@ -1934,7 +1934,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the starting group */ - if((gid = H5I_register(H5I_GROUP, grp)) < 0) + if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") /* Get the location of the starting group */ @@ -2017,7 +2017,7 @@ done: /* Release the group opened */ if(gid > 0) { - if(H5I_dec_ref(gid) < 0) + if(H5I_dec_ref(gid, TRUE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") } /* end if */ else if(grp && H5G_close(grp) < 0) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 16531a7..c1b49bc 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -222,7 +222,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") /* Make a copy of the default property list */ - if((tmp_gcpl = H5P_copy_plist(gc_plist)) < 0) + if((tmp_gcpl = H5P_copy_plist(gc_plist, FALSE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") /* Get pointer to the copied property list */ @@ -245,12 +245,12 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) if(NULL == (grp = H5G_create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl, H5P_GROUP_ACCESS_DEFAULT, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: if(tmp_gcpl > 0 && tmp_gcpl != H5P_GROUP_CREATE_DEFAULT) - if(H5I_dec_ref(tmp_gcpl) < 0) + if(H5I_dec_ref(tmp_gcpl, TRUE) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release property list") if(ret_value < 0) @@ -299,7 +299,7 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an atom for the group */ - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: diff --git a/src/H5Gname.c b/src/H5Gname.c index 072673a..0a9bd69 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -452,17 +452,17 @@ H5G_get_name(hid_t id, char *name/*out*/, size_t size, hid_t lapl_id, hid_t file; /* Retrieve file ID for name search */ - if((file = H5I_get_file_id(id)) < 0) + if((file = H5I_get_file_id(id, FALSE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve file ID") /* Search for name of object */ if((len = H5G_get_name_by_addr(file, lapl_id, dxpl_id, loc.oloc, name, size)) < 0) { - H5I_dec_ref(file); + H5I_dec_ref(file, FALSE); HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine name") } /* end if */ /* Close file ID used for search */ - if(H5I_dec_ref(file) < 0) + if(H5I_dec_ref(file, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCLOSEFILE, FAIL, "can't determine name") } /* end else */ diff --git a/src/H5Goh.c b/src/H5Goh.c index 3ccdf16..7894194 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -46,7 +46,8 @@ /********************/ static htri_t H5O_group_isa(H5O_t *loc); -static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t dxpl_id); +static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, + hbool_t app_ref); static void *H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); static H5O_loc_t *H5O_group_get_oloc(hid_t obj_id); @@ -134,7 +135,7 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_group_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O_group_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t app_ref) { H5G_t *grp = NULL; /* Group opened */ hid_t ret_value; /* Return value */ @@ -148,7 +149,7 @@ H5O_group_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the group */ - if((ret_value = H5I_register(H5I_GROUP, grp)) < 0) + if((ret_value = H5I_register(H5I_GROUP, grp, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index dcc77c2..8409c0f 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -194,7 +194,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, /* Create a group to pass to the user-defined callback */ if((grp = H5G_open(&grp_loc_copy, dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((cur_grp = H5I_register(H5I_GROUP, grp)) < 0) + if((cur_grp = H5I_register(H5I_GROUP, grp, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") /* Check for generic default property list and use link access default if so */ @@ -210,7 +210,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, } /* end else */ /* Copy the property list passed in */ - if((lapl_id = H5P_copy_plist(lapl)) < 0) + if((lapl_id = H5P_copy_plist(lapl, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to copy property list") /* Get the underlying property list copy */ @@ -266,22 +266,22 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, /* We have a copy of the location and we're holding the file open. * Close the open ID the user passed back. */ - if(H5I_dec_ref(cb_return) < 0) + if(H5I_dec_ref(cb_return, FALSE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") cb_return = (-1); done: /* Close location given to callback. */ if(cur_grp > 0) - if(H5I_dec_ref(cur_grp) < 0) + if(H5I_dec_ref(cur_grp, FALSE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for current location") if(ret_value < 0 && cb_return > 0) - if(H5I_dec_ref(cb_return) < 0) + if(H5I_dec_ref(cb_return, FALSE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") /* Close the LAPL, if we copied one */ - if(lapl_id > 0 && H5I_dec_ref(lapl_id) < 0) + if(lapl_id > 0 && H5I_dec_ref(lapl_id, FALSE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close copied link access property list") FUNC_LEAVE_NOAPI(ret_value) @@ -90,6 +90,7 @@ typedef struct H5I_id_info_t { hid_t id; /* ID for this info */ unsigned count; /* ref. count for this atom */ + unsigned app_count; void *obj_ptr; /* pointer associated with the atom */ struct H5I_id_info_t *next; /* link to next atom (in case of hash-clash)*/ } H5I_id_info_t; @@ -528,7 +529,7 @@ herr_t H5Iclear_type(H5I_type_t type, hbool_t force) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type"); } - ret_value = H5I_clear_type(type, force); + ret_value = H5I_clear_type(type, force, TRUE); done: FUNC_LEAVE_API(ret_value); @@ -561,10 +562,16 @@ herr_t H5Iclear_type(H5I_type_t type, hbool_t force) * things like property lists, files, etc. Objects that have a * reference count larger than one are not affected unless FORCE * is non-zero. + * + * Neil Fortner, 2008-08-08 + * Added app_ref parameter. If app_ref is FALSE, then the + * application reference count is ignored (i.e. subtracted from + * the total reference count) when determining which id's to + * close. *------------------------------------------------------------------------- */ herr_t -H5I_clear_type(H5I_type_t type, hbool_t force) +H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) { H5I_id_type_t *type_ptr = NULL; /* ptr to the atomic type */ H5I_id_info_t *cur=NULL; /* Current node being worked with */ @@ -595,7 +602,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) * Do nothing to the object if the reference count is larger than * one and forcing is off. */ - if (!force && cur->count>1) { + if (!force && (cur->count - (!app_ref * cur->app_count)) >1) { next=cur->next; continue; } /* end if */ @@ -739,7 +746,7 @@ herr_t H5I_destroy_type(H5I_type_t type) if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type"); - H5I_clear_type(type, TRUE); + H5I_clear_type(type, TRUE, FALSE); H5E_clear_stack(NULL); /*don't care about errors*/ H5MM_xfree(type_ptr->id_list); @@ -779,7 +786,7 @@ hid_t H5Iregister(H5I_type_t type, void *object) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type"); } - ret_value = H5I_register(type, object); + ret_value = H5I_register(type, object, TRUE); done: FUNC_LEAVE_API(ret_value); @@ -805,10 +812,15 @@ hid_t H5Iregister(H5I_type_t type, void *object) * * Modifications: * + * Neil Fortner, 7 Aug 2008 + * Added app_ref parameter and support for the app_count field, to + * distiguish between reference count from the library and from the + * application. + * *------------------------------------------------------------------------- */ hid_t -H5I_register(H5I_type_t type, void *object) +H5I_register(H5I_type_t type, void *object, hbool_t app_ref) { H5I_id_type_t *type_ptr=NULL; /*ptr to the type */ H5I_id_info_t *id_ptr=NULL; /*ptr to the new ID information */ @@ -834,6 +846,7 @@ H5I_register(H5I_type_t type, void *object) new_id = H5I_MAKE(type, type_ptr->nextid); id_ptr->id = new_id; id_ptr->count = 1; /*initial reference count*/ + id_ptr->app_count = !!app_ref; id_ptr->obj_ptr = object; id_ptr->next = NULL; @@ -1268,7 +1281,7 @@ H5Idec_ref(hid_t id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID"); /* Do actual decrement operation */ - if((ret_value = H5I_dec_ref(id))<0) + if((ret_value = H5I_dec_ref(id, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count"); done: @@ -1312,10 +1325,15 @@ done: * count 1. This feature is needed by file close with H5F_CLOSE_SEMI * value. * + * Neil Fortner, 7 Aug 2008 + * Added app_ref parameter and support for the app_count field, to + * distiguish between reference count from the library and from the + * application. + * *------------------------------------------------------------------------- */ int -H5I_dec_ref(hid_t id) +H5I_dec_ref(hid_t id, hbool_t app_ref) { H5I_type_t type; /*type the object is in*/ H5I_id_type_t *type_ptr; /*ptr to the type */ @@ -1357,7 +1375,11 @@ H5I_dec_ref(hid_t id) ret_value = FAIL; } } else { - ret_value = --(id_ptr->count); + --(id_ptr->count); + if (app_ref) + --(id_ptr->app_count); + HDassert((id_ptr->count >= id_ptr->app_count) && (id_ptr->app_count >= 0)); + ret_value = app_ref ? id_ptr->app_count : id_ptr->count; } done: @@ -1393,7 +1415,7 @@ H5Iinc_ref(hid_t id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID"); /* Do actual increment operation */ - if((ret_value = H5I_inc_ref(id))<0) + if((ret_value = H5I_inc_ref(id, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); done: @@ -1415,10 +1437,15 @@ done: * * Modifications: * + * Neil Fortner, 7 Aug 2008 + * Added app_ref parameter and support for the app_count field, to + * distiguish between reference count from the library and from the + * application. + * *------------------------------------------------------------------------- */ int -H5I_inc_ref(hid_t id) +H5I_inc_ref(hid_t id, hbool_t app_ref) { H5I_type_t type; /*type the object is in*/ H5I_id_type_t *type_ptr; /*ptr to the type */ @@ -1442,8 +1469,12 @@ H5I_inc_ref(hid_t id) if (NULL==(id_ptr=H5I_find_id(id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); + /* Adjust reference counts */ + ++(id_ptr->count); + if (app_ref) + ++(id_ptr->app_count); /* Set return value */ - ret_value=++(id_ptr->count); + ret_value = app_ref ? id_ptr->app_count : id_ptr->count; done: FUNC_LEAVE_NOAPI(ret_value); @@ -1478,7 +1509,7 @@ H5Iget_ref(hid_t id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID"); /* Do actual retrieve operation */ - if((ret_value = H5I_get_ref(id))<0) + if((ret_value = H5I_get_ref(id, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count"); done: @@ -1500,10 +1531,15 @@ done: * * Modifications: * + * Neil Fortner, 7 Aug 2008 + * Added app_ref parameter and support for the app_count field, to + * distiguish between reference count from the library and from the + * application. + * *------------------------------------------------------------------------- */ int -H5I_get_ref(hid_t id) +H5I_get_ref(hid_t id, hbool_t app_ref) { H5I_type_t type; /*type the object is in*/ H5I_id_type_t *type_ptr; /*ptr to the type */ @@ -1528,7 +1564,7 @@ H5I_get_ref(hid_t id) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); /* Set return value */ - ret_value=id_ptr->count; + ret_value = app_ref ? id_ptr->app_count : id_ptr->count; done: FUNC_LEAVE_NOAPI(ret_value); @@ -1802,7 +1838,7 @@ H5I_get_type_ref(H5I_type_t type) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5I_get_ref() */ +} /* end H5I_get_type_ref() */ /*------------------------------------------------------------------------- @@ -2036,7 +2072,7 @@ H5Iget_file_id(hid_t obj_id) FUNC_ENTER_API(H5Iget_file_id, FAIL); H5TRACE1("i", "i", obj_id); - if((ret_value = H5I_get_file_id(obj_id))<0) + if((ret_value = H5I_get_file_id(obj_id, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID"); done: @@ -2060,7 +2096,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5I_get_file_id(hid_t obj_id) +H5I_get_file_id(hid_t obj_id, hbool_t app_ref) { H5G_loc_t loc; /* Location of object */ H5I_type_t type; /* ID type */ @@ -2074,13 +2110,13 @@ H5I_get_file_id(hid_t obj_id) ret_value = obj_id; /* Increment reference count on atom. */ - if(H5I_inc_ref(ret_value) < 0) + if(H5I_inc_ref(ret_value, app_ref) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") } else if(type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get object location") - if((ret_value = H5F_get_id(loc.oloc->file)) < 0) + if((ret_value = H5F_get_id(loc.oloc->file, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get file ID") } else diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 42575e4..f06bf79 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -52,19 +52,19 @@ /* Private Functions in H5I.c */ H5_DLL H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned reserved, H5I_free_t free_func); H5_DLL int H5I_nmembers(H5I_type_t type); -H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force); +H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref); H5_DLL int H5I_destroy_type(H5I_type_t type); -H5_DLL hid_t H5I_register(H5I_type_t type, void *object); +H5_DLL hid_t H5I_register(H5I_type_t type, void *object, hbool_t app_ref); H5_DLL void *H5I_object(hid_t id); H5_DLL void *H5I_object_verify(hid_t id, H5I_type_t id_type); H5_DLL H5I_type_t H5I_get_type(hid_t id); -H5_DLL hid_t H5I_get_file_id(hid_t); +H5_DLL hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref); H5_DLL void *H5I_remove(hid_t id); H5_DLL void *H5I_remove_verify(hid_t id, H5I_type_t id_type); H5_DLL void *H5I_search(H5I_type_t type, H5I_search_func_t func, void *key); -H5_DLL int H5I_get_ref(hid_t id); -H5_DLL int H5I_inc_ref(hid_t id); -H5_DLL int H5I_dec_ref(hid_t id); +H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); +H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref); +H5_DLL int H5I_dec_ref(hid_t id, hbool_t app_ref); H5_DLL int H5I_inc_type_ref(H5I_type_t type); H5_DLL herr_t H5I_dec_type_ref(H5I_type_t type); H5_DLL int H5I_get_type_ref(H5I_type_t type); @@ -1743,7 +1743,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED /* Set up location for user-defined callback */ if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((grp_id = H5I_register(H5I_GROUP, grp)) < 0) + if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register ID for group") /* Make callback */ @@ -1755,7 +1755,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED done: /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { - if(H5I_dec_ref(grp_id) < 0) + if(H5I_dec_ref(grp_id, TRUE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { @@ -2440,7 +2440,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, /* Set up location for user-defined callback */ if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((grp_id = H5I_register(H5I_GROUP, grp)) < 0) + if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group ID") if(udata->copy) { @@ -2457,7 +2457,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, done: /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { - if(H5I_dec_ref(grp_id) < 0) + if(H5I_dec_ref(grp_id, TRUE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { @@ -2657,7 +2657,7 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, else { if(NULL == (la_plist = (H5P_genplist_t *)H5I_object(lapl_id))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid access PL") - if((lapl_copy = H5P_copy_plist(la_plist)) < 0) + if((lapl_copy = H5P_copy_plist(la_plist, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy access properties") } /* end else */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 4e355bb..ac4fe17 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -228,7 +228,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, * users can override this callback using H5Lregister. */ intent = H5F_INTENT(loc.oloc->file); - if((fapl_id = H5F_get_access_plist(loc.oloc->file)) < 0) + if((fapl_id = H5F_get_access_plist(loc.oloc->file, FALSE)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get file access property list") /* Check for non-"weak" file close degree for parent file */ @@ -340,7 +340,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unable to create location for file") /* Open the object referenced in the external file */ - if((ext_obj = H5O_open_name(&root_loc, obj_name, lapl_id)) < 0) { + if((ext_obj = H5O_open_name(&root_loc, obj_name, lapl_id, FALSE)) < 0) { H5F_decr_nopen_objs(ext_file); HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") } /* end if */ @@ -358,13 +358,13 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, done: /* Release resources */ - if(fapl_id > 0 && H5I_dec_ref(fapl_id) < 0) + if(fapl_id > 0 && H5I_dec_ref(fapl_id, FALSE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for file access property list") if(ext_file && H5F_try_close(ext_file) < 0) HDONE_ERROR(H5E_LINK, H5E_CANTCLOSEFILE, FAIL, "problem closing external file") /* Close object if it's open and something failed */ - if(ret_value < 0 && ext_obj >= 0 && H5I_dec_ref(ext_obj) < 0) + if(ret_value < 0 && ext_obj >= 0 && H5I_dec_ref(ext_obj, FALSE) < 0) HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom for external object") FUNC_LEAVE_NOAPI(ret_value) @@ -238,7 +238,7 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Open the object */ - if((ret_value = H5O_open_name(&loc, name, lapl_id)) < 0) + if((ret_value = H5O_open_name(&loc, name, lapl_id, TRUE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -309,7 +309,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, loc_found = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_dxpl_id)) < 0) + if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_dxpl_id, TRUE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -385,7 +385,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_dxpl_id)) < 0) + if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_dxpl_id, TRUE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -1012,7 +1012,7 @@ H5Oclose(hid_t object_id) case(H5I_DATASET): if(H5I_object(object_id) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") - if(H5I_dec_ref(object_id) < 0) + if(H5I_dec_ref(object_id, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") break; @@ -1259,7 +1259,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id) +H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -1284,7 +1284,7 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id) loc_found = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_ind_dxpl_id)) < 0) + if((ret_value = H5O_open_by_loc(&obj_loc, H5AC_ind_dxpl_id, app_ref)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -1310,7 +1310,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t app_ref) { const H5O_obj_class_t *obj_class; /* Class of object for location */ hid_t ret_value; /* Return value */ @@ -1325,7 +1325,7 @@ H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t dxpl_id) /* Call the object class's 'open' routine */ HDassert(obj_class->open); - if((ret_value = obj_class->open(obj_loc, dxpl_id)) < 0) + if((ret_value = obj_class->open(obj_loc, dxpl_id, app_ref)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: @@ -2805,7 +2805,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* Open the object */ /* (Takes ownership of the obj_loc information) */ - if((obj_id = H5O_open_by_loc(&obj_loc, dxpl_id)) < 0) + if((obj_id = H5O_open_by_loc(&obj_loc, dxpl_id, TRUE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Make callback for starting object */ @@ -2857,7 +2857,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: if(obj_id > 0) { - if(H5I_dec_ref(obj_id) < 0) + if(H5I_dec_ref(obj_id, TRUE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") } /* end if */ else if(loc_found && H5G_loc_free(&obj_loc) < 0) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index ced85c2..0d62d9e 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -777,17 +777,17 @@ H5O_attr_copy_file(H5F_t UNUSED *file_src, const H5O_msg_class_t UNUSED *mesg_ty size_t buf_size; /* Size of copy buffer */ /* Create datatype ID for src datatype */ - if((tid_src = H5I_register(H5I_DATATYPE, attr_src->shared->dt)) < 0) + if((tid_src = H5I_register(H5I_DATATYPE, attr_src->shared->dt, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source file datatype") /* create a memory copy of the variable-length datatype */ if(NULL == (dt_mem = H5T_copy(attr_src->shared->dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy") - if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem)) < 0) + if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register memory datatype") /* create variable-length datatype at the destinaton file */ - if((tid_dst = H5I_register(H5I_DATATYPE, attr_dst->shared->dt)) < 0) + if((tid_dst = H5I_register(H5I_DATATYPE, attr_dst->shared->dt, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination file datatype") /* Set up the conversion functions */ @@ -821,7 +821,7 @@ H5O_attr_copy_file(H5F_t UNUSED *file_src, const H5O_msg_class_t UNUSED *mesg_ty HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace") /* Atomize */ - if((buf_sid = H5I_register(H5I_DATASPACE, buf_space)) < 0) { + if((buf_sid = H5I_register(H5I_DATASPACE, buf_space, FALSE)) < 0) { H5S_close(buf_space); HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, NULL, "unable to register dataspace ID") } /* end if */ @@ -869,7 +869,7 @@ H5O_attr_copy_file(H5F_t UNUSED *file_src, const H5O_msg_class_t UNUSED *mesg_ty done: if(buf_sid > 0) - if(H5I_dec_ref(buf_sid) < 0) + if(H5I_dec_ref(buf_sid, FALSE) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary dataspace ID") if(tid_src > 0) /* Don't decrement ID, we want to keep underlying datatype */ @@ -881,7 +881,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary datatype ID") if(tid_mem > 0) /* Decrement the memory datatype ID, it's transient */ - if(H5I_dec_ref(tid_mem) < 0) + if(H5I_dec_ref(tid_mem, FALSE) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary datatype ID") if(buf) buf = H5FL_BLK_FREE(attr_buf, buf); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index fccf430..613a6fd 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -534,35 +534,35 @@ H5O_fill_copy(const void *_src, void *_dst) size_t bkg_size; /* Size of background buffer */ /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->type, H5T_COPY_TRANSIENT)); + dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->type, H5T_COPY_TRANSIENT), FALSE); if(dst_id < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy/register datatype") - src_id = H5I_register(H5I_DATATYPE, H5T_copy(src->type, H5T_COPY_ALL)); + src_id = H5I_register(H5I_DATATYPE, H5T_copy(src->type, H5T_COPY_ALL), FALSE); if(src_id < 0) { - H5I_dec_ref(dst_id); + H5I_dec_ref(dst_id, FALSE); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy/register datatype") } /* end if */ /* Allocate a background buffer */ bkg_size = MAX(H5T_get_size(dst->type), H5T_get_size(src->type)); if(H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } /* end if */ /* Convert fill value */ if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf, H5AC_ind_dxpl_id) < 0) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); if(bkg_buf) H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "datatype conversion failed") } /* end if */ /* Release the background buffer */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); if(bkg_buf) H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ @@ -696,7 +696,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) /* Copy the fill value datatype and get an ID for it */ if(NULL == (fill_type = H5T_copy(fill->type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy fill value datatype") - if((fill_type_id = H5I_register(H5I_DATATYPE, fill_type)) < 0) { + if((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, FALSE)) < 0) { H5T_close(fill_type); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register fill value datatype") } /* end if */ @@ -726,7 +726,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) done: if(fill_type_id > 0) - H5I_dec_ref(fill_type_id); + H5I_dec_ref(fill_type_id, FALSE); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_reset_dyn() */ @@ -938,8 +938,8 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ /* Don't bother doing anything if there will be no actual conversion */ if(!H5T_path_noop(tpath)) { - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill->type, H5T_COPY_ALL))) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dset_type, H5T_COPY_ALL))) < 0) + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill->type, H5T_COPY_ALL), FALSE)) < 0 || + (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dset_type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register data type") /* @@ -978,9 +978,9 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ done: if(src_id >= 0) - H5I_dec_ref(src_id); + H5I_dec_ref(src_id, FALSE); if(dst_id >= 0) - H5I_dec_ref(dst_id); + H5I_dec_ref(dst_id, FALSE); if(buf != fill->buf) H5MM_xfree(buf); if(bkg) diff --git a/src/H5Olink.c b/src/H5Olink.c index 6298a27..bdbe055 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -628,17 +628,17 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) hid_t file_id; /* ID for the file the link is located in (passed to user callback) */ /* Get a file ID for the file the link is in */ - if((file_id = H5F_get_id(f)) < 0) + if((file_id = H5F_get_id(f, FALSE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get file ID") /* Call user-defined link's 'delete' callback */ if((link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size) < 0) { - H5I_dec_ref(file_id); + H5I_dec_ref(file_id, FALSE); HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "link deletion callback returned failure") } /* end if */ /* Release the file ID */ - if(H5I_dec_ref(file_id) < 0) + if(H5I_dec_ref(file_id, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "can't close file") } /* end if */ } /* end if */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index deffdac..16248ca 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -315,7 +315,7 @@ typedef struct H5O_obj_class_t { void *(*get_copy_file_udata)(void); /*retrieve user data for 'copy file' operation */ void (*free_copy_file_udata)(void *); /*free user data for 'copy file' operation */ htri_t (*isa)(H5O_t *); /*if a header matches an object class */ - hid_t (*open)(const H5G_loc_t *, hid_t ); /*open an object of this class */ + hid_t (*open)(const H5G_loc_t *, hid_t, hbool_t ); /*open an object of this class */ void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */ H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */ } H5O_obj_class_t; @@ -470,7 +470,7 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; /* Package-local function prototypes */ H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); -H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t dxpl_id); +H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t app_ref); H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg); H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 36ff226..a5b9db3 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -559,7 +559,7 @@ H5_DLL herr_t H5O_get_info(H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, H5O_info_t *oinfo); H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id); H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist); -H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id); +H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref); H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks); H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh); @@ -128,7 +128,7 @@ H5Pcopy(hid_t id) /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { - if((ret_value = H5P_copy_plist(obj)) < 0) + if((ret_value = H5P_copy_plist(obj, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list"); } /* end if */ /* Must be property classes */ @@ -140,7 +140,7 @@ H5Pcopy(hid_t id) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property class"); /* Get an atom for the copied class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class)) < 0) { + if((ret_value = H5I_register(H5I_GENPROP_CLS, copy_class, TRUE)) < 0) { H5P_close_class(copy_class); HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); } /* end if */ @@ -221,7 +221,7 @@ H5Pcreate_class(hid_t parent, const char *name, HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list class"); /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass)) < 0) + if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); done: @@ -268,7 +268,7 @@ H5Pcreate(hid_t cls_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class"); /* Create the new property list */ - if((ret_value = H5P_create_id(pclass)) < 0) + if((ret_value = H5P_create_id(pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list"); done: @@ -856,7 +856,7 @@ H5Pget_class(hid_t plist_id) HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count"); /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass)) < 0) + if((ret_value = H5I_register(H5I_GENPROP_CLS, pclass, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); done: @@ -1374,7 +1374,7 @@ H5Pclose(hid_t plist_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); /* Close the property list */ - if(H5I_dec_ref(plist_id) < 0) + if(H5I_dec_ref(plist_id, TRUE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close"); done: @@ -1465,7 +1465,7 @@ H5Pget_class_parent(hid_t pclass_id) HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ID ref count"); /* Get an atom for the class */ - if((ret_value = H5I_register(H5I_GENPROP_CLS, parent)) < 0) + if((ret_value = H5I_register(H5I_GENPROP_CLS, parent, TRUE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); done: @@ -1507,7 +1507,7 @@ H5Pclose_class(hid_t cls_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class"); /* Close the property list class */ - if(H5I_dec_ref(cls_id) < 0) + if(H5I_dec_ref(cls_id, TRUE) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close"); done: diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index b971174..c3e9bd6 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2192,7 +2192,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, */ if(NULL == (tpath = H5T_path_find(fill.type, type, NULL, NULL, dxpl_id, FALSE))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") - if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT))) < 0) + if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype") /* @@ -2214,7 +2214,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, HDmemcpy(buf, fill.buf, H5T_get_size(fill.type)); /* Do the conversion */ - if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_TRANSIENT))) < 0) + if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype") if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") @@ -2227,9 +2227,9 @@ done: if(bkg != value) H5MM_xfree(bkg); if(src_id >= 0) - H5I_dec_ref(src_id); + H5I_dec_ref(src_id, FALSE); if(dst_id >= 0) - H5I_dec_ref(dst_id); + H5I_dec_ref(dst_id, FALSE); FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_get_fill_value() */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 233e187..37912e6 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -419,13 +419,13 @@ H5P_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register properties") /* Register the new class */ - if((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, new_pclass)) < 0) + if((*lib_class->class_id = H5I_register(H5I_GENPROP_CLS, new_pclass, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class") /* Only register the default property list if it hasn't been created yet */ if(lib_class->def_plist_id && *lib_class->def_plist_id == (-1)) { /* Register the default property list for the new class*/ - if((*lib_class->def_plist_id = H5P_create_id(new_pclass)) < 0) + if((*lib_class->def_plist_id = H5P_create_id(new_pclass, FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register default property list for class") } /* end if */ @@ -482,7 +482,7 @@ H5P_term_interface(void) if(n) { /* Clear the lists */ if(nlist>0) { - H5I_clear_type(H5I_GENPROP_LST, FALSE); + H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ if(H5I_nmembers(H5I_GENPROP_LST)==0) { @@ -505,7 +505,7 @@ H5P_term_interface(void) /* Only attempt to close the classes after all the lists are closed */ if(nlist==0 && nclass>0) { - H5I_clear_type(H5I_GENPROP_CLS, FALSE); + H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ if(H5I_nmembers(H5I_GENPROP_CLS)==0) { @@ -636,7 +636,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_copy_plist(H5P_genplist_t *old_plist) +H5P_copy_plist(H5P_genplist_t *old_plist, hbool_t app_ref) { H5P_genclass_t *tclass; /* Temporary class pointer */ H5P_genplist_t *new_plist=NULL; /* New property list generated from copy */ @@ -793,7 +793,7 @@ H5P_copy_plist(H5P_genplist_t *old_plist) HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL,"Can't increment class ref count"); /* Get an atom for the property list */ - if((new_plist_id = H5I_register(H5I_GENPROP_LST, new_plist)) < 0) + if((new_plist_id = H5I_register(H5I_GENPROP_LST, new_plist, app_ref)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list"); /* Save the property list ID in the property list struct, for use in the property class's 'close' callback */ @@ -1672,7 +1672,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5P_create_id(H5P_genclass_t *pclass) +H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) { H5P_genplist_t *plist=NULL; /* Property list created */ hid_t plist_id=FAIL; /* Property list ID */ @@ -1687,7 +1687,7 @@ H5P_create_id(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list"); /* Get an atom for the property list */ - if((plist_id = H5I_register(H5I_GENPROP_LST, plist)) < 0) + if((plist_id = H5I_register(H5I_GENPROP_LST, plist, app_ref)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list"); /* Save the property list ID in the property list struct, for use in the property class's 'close' callback */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index adb57c1..d4264bc 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -57,8 +57,8 @@ H5_DLL herr_t H5P_init(void); /* Internal versions of API routines */ H5_DLL herr_t H5P_close(void *_plist); -H5_DLL hid_t H5P_create_id(H5P_genclass_t *pclass); -H5_DLL hid_t H5P_copy_plist(H5P_genplist_t *old_plist); +H5_DLL hid_t H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref); +H5_DLL hid_t H5P_copy_plist(H5P_genplist_t *old_plist, hbool_t app_ref); H5_DLL herr_t H5P_get(const H5P_genplist_t *plist, const char *name, void *value); H5_DLL herr_t H5P_set(H5P_genplist_t *plist, const char *name, const void *value); H5_DLL herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 4a3bca5..48e4fec 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -115,7 +115,7 @@ H5P_open_class_path_test(const char *path) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "unable to find class with full path"); /* Get an atom for the class */ - if ((ret_value=H5I_register(H5I_GENPROP_CLS, pclass))<0) + if ((ret_value=H5I_register(H5I_GENPROP_CLS, pclass, TRUE))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to atomize property list class"); done: @@ -37,7 +37,8 @@ /* Static functions */ static herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); -static hid_t H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref); +static hid_t H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, + const void *_ref, hbool_t app_ref); static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); static ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, const void *_ref, char *name, size_t size); @@ -123,7 +124,7 @@ H5R_term_interface(void) if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_REFERENCE))) { - H5I_clear_type(H5I_REFERENCE, FALSE); + H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); } else { H5I_dec_type_ref(H5I_REFERENCE); H5_interface_initialize_g = 0; @@ -359,7 +360,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static hid_t -H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref) +H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) { H5O_loc_t oloc; /* Object location */ H5G_name_t path; /* Path of object */ @@ -436,7 +437,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") /* Create an atom for the group */ - if((ret_value = H5I_register(H5I_GROUP, group)) < 0) { + if((ret_value = H5I_register(H5I_GROUP, group, app_ref)) < 0) { H5G_close(group); HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "can't register group") } /* end if */ @@ -451,7 +452,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") /* Create an atom for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type)) < 0) { + if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) { H5T_close(type); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register datatype") } /* end if */ @@ -467,7 +468,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") /* Create an atom for the dataset */ - if((ret_value = H5I_register(H5I_DATASET, dset)) < 0) { + if((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) { H5D_close(dset); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset") } /* end if */ @@ -527,7 +528,7 @@ H5Rdereference(hid_t id, H5R_type_t ref_type, const void *_ref) file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, H5AC_dxpl_id, ref_type, _ref)) < 0) + if((ret_value = H5R_dereference(file, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") done: @@ -650,7 +651,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") /* Atomize */ - if((ret_value = H5I_register (H5I_DATASPACE, space)) < 0) + if((ret_value = H5I_register (H5I_DATASPACE, space, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") done: @@ -881,7 +882,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty } /* end switch */ /* Retrieve file ID for name search */ - if((file_id = H5I_get_file_id(id)) < 0) + if((file_id = H5I_get_file_id(id, FALSE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID") /* Get name, length, etc. */ @@ -891,7 +892,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty done: /* Close file ID used for search */ if(file_id > 0) - if(H5I_dec_ref(file_id) < 0) + if(H5I_dec_ref(file_id, FALSE) < 0) HDONE_ERROR(H5E_REFERENCE, H5E_CANTCLOSEFILE, FAIL, "can't determine name") FUNC_LEAVE_NOAPI(ret_value) @@ -122,7 +122,7 @@ H5S_term_interface(void) if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_DATASPACE))) { - H5I_clear_type(H5I_DATASPACE, FALSE); + H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); } /* end if */ else { /* Free data types */ @@ -249,7 +249,7 @@ H5Screate(H5S_class_t type) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "unable to create dataspace") /* Atomize */ - if((ret_value = H5I_register (H5I_DATASPACE, new_ds)) < 0) + if((ret_value = H5I_register (H5I_DATASPACE, new_ds, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom") done: @@ -360,7 +360,7 @@ H5Sclose(hid_t space_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") /* When the reference count reaches zero the resources are freed */ - if (H5I_dec_ref(space_id) < 0) + if (H5I_dec_ref(space_id, TRUE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") done: @@ -403,7 +403,7 @@ H5Scopy(hid_t space_id) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to copy data space") /* Atomize */ - if ((ret_value=H5I_register (H5I_DATASPACE, dst))<0) + if ((ret_value=H5I_register (H5I_DATASPACE, dst, TRUE))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space atom") done: @@ -1308,7 +1308,7 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Atomize */ - if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) + if ((ret_value=H5I_register (H5I_DATASPACE, space, TRUE))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") done: @@ -1509,7 +1509,7 @@ H5Sdecode(const void *buf) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ - if((ret_value = H5I_register(H5I_DATASPACE, ds)) < 0) + if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTREGISTER, FAIL, "unable to register dataspace") done: diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 455a251..2680e2a 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -6953,7 +6953,7 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection"); /* Atomize */ - if ((ret_value=H5I_register (H5I_DATASPACE, new_space))<0) + if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom"); done: @@ -7081,7 +7081,7 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection"); /* Atomize */ - if ((ret_value=H5I_register (H5I_DATASPACE, new_space))<0) + if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom"); done: @@ -487,7 +487,7 @@ static H5T_t *H5T_decode(const unsigned char *buf); H5_GLUE3(H5T_INIT_TYPE_,GUTS,_CORE) \ \ /* Atomize result */ \ - if((GLOBAL = H5I_register(H5I_DATATYPE, dt)) < 0) \ + if((GLOBAL = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") \ } @@ -1322,7 +1322,7 @@ H5T_init_interface(void) /* Only register the default property list if it hasn't been created yet */ if(H5P_LST_DATATYPE_CREATE_g==(-1)) { /* Register the default datatype creation property list */ - if((H5P_LST_DATATYPE_CREATE_g = H5P_create_id(crt_pclass))<0) + if((H5P_LST_DATATYPE_CREATE_g = H5P_create_id(crt_pclass, FALSE))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't insert property into class") } /* end if */ @@ -1599,7 +1599,7 @@ H5Tcreate(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type"); /* Make it an atom */ - if ((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom"); done: @@ -1666,7 +1666,7 @@ H5Tcopy(hid_t type_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); /* Atomize result */ - if ((ret_value = H5I_register(H5I_DATATYPE, new_dt)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom"); done: @@ -1709,7 +1709,7 @@ H5Tclose(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable data type"); /* When the reference count reaches zero the resources are freed */ - if (H5I_dec_ref(type_id) < 0) + if (H5I_dec_ref(type_id, TRUE) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id"); done: @@ -2179,7 +2179,7 @@ H5Tget_super(hid_t type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if((super=H5T_get_super(dt))==NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a data type"); - if ((ret_value=H5I_register(H5I_DATATYPE, super))<0) + if ((ret_value=H5I_register(H5I_DATATYPE, super, TRUE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent data type"); done: @@ -2323,15 +2323,15 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, old_path->dst->shared->type!=dst->shared->type) { continue; } - if ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL)))<0 || - (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL)))<0) + if ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE))<0 || + (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query"); HDmemset(&cdata, 0, sizeof cdata); cdata.command = H5T_CONV_INIT; if ((func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); + H5I_dec_ref(tmp_sid, FALSE); + H5I_dec_ref(tmp_did, FALSE); tmp_sid = tmp_did = -1; H5E_clear_stack(NULL); continue; @@ -2371,8 +2371,8 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5FL_FREE(H5T_path_t,old_path); /* Release temporary atoms */ - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); + H5I_dec_ref(tmp_sid, FALSE); + H5I_dec_ref(tmp_did, FALSE); tmp_sid = tmp_did = -1; /* We don't care about any failures during the freeing process */ @@ -2390,9 +2390,9 @@ done: H5FL_FREE(H5T_path_t,new_path); } /* end if */ if (tmp_sid>=0) - H5I_dec_ref(tmp_sid); + H5I_dec_ref(tmp_sid, FALSE); if (tmp_did>=0) - H5I_dec_ref(tmp_did); + H5I_dec_ref(tmp_did, FALSE); } /* end if */ FUNC_LEAVE_NOAPI(ret_value); @@ -2824,7 +2824,7 @@ H5Tdecode(const void *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object") /* Register the type and return the ID */ - if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") done: @@ -4360,17 +4360,17 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, assert(path!=table); assert(NULL==path->func); if (path->src && (src_id=H5I_register(H5I_DATATYPE, - H5T_copy(path->src, H5T_COPY_ALL)))<0) + H5T_copy(path->src, H5T_COPY_ALL), FALSE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query"); if (path->dst && (dst_id=H5I_register(H5I_DATATYPE, - H5T_copy(path->dst, H5T_COPY_ALL)))<0) + H5T_copy(path->dst, H5T_COPY_ALL), FALSE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query"); path->cdata.command = H5T_CONV_INIT; if ((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function"); - if (src_id>=0) H5I_dec_ref(src_id); - if (dst_id>=0) H5I_dec_ref(dst_id); + if (src_id>=0) H5I_dec_ref(src_id, FALSE); + if (dst_id>=0) H5I_dec_ref(dst_id, FALSE); src_id = dst_id = -1; path->func = func; path->is_hard = TRUE; @@ -4389,9 +4389,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, continue; } if ((src_id=H5I_register(H5I_DATATYPE, - H5T_copy(path->src, H5T_COPY_ALL)))<0 || + H5T_copy(path->src, H5T_COPY_ALL), FALSE))<0 || (dst_id=H5I_register(H5I_DATATYPE, - H5T_copy(path->dst, H5T_COPY_ALL)))<0) + H5T_copy(path->dst, H5T_COPY_ALL), FALSE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register conversion types for query"); path->cdata.command = H5T_CONV_INIT; if ((H5T_g.soft[i].func) (src_id, dst_id, &(path->cdata), @@ -4403,8 +4403,8 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->func = H5T_g.soft[i].func; path->is_hard = FALSE; } - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + H5I_dec_ref(src_id, FALSE); + H5I_dec_ref(dst_id, FALSE); src_id = dst_id = -1; } if (!path->func) @@ -4487,8 +4487,8 @@ done: if (path->dst) H5T_close(path->dst); H5FL_FREE(H5T_path_t,path); } - if (src_id>=0) H5I_dec_ref(src_id); - if (dst_id>=0) H5I_dec_ref(dst_id); + if (src_id>=0) H5I_dec_ref(src_id, FALSE); + if (dst_id>=0) H5I_dec_ref(dst_id, FALSE); FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 00f1177..1367272 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -98,7 +98,7 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") /* Atomize the type */ - if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: @@ -352,7 +352,7 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") /* Atomize the type */ - if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index bcb9962..aa11101 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -534,7 +534,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") /* Register the type and return the ID */ - if((ret_value = H5I_register(H5I_DATATYPE, type)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") done: @@ -586,7 +586,7 @@ H5Tget_create_plist(hid_t dtype_id) /* Copy the default datatype creation property list */ if(NULL == (tcpl_plist = H5I_object(H5P_LST_DATATYPE_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default creation property list") - if((new_tcpl_id = H5P_copy_plist(tcpl_plist)) < 0) + if((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list") /* Check if the datatype is committed */ @@ -612,7 +612,7 @@ H5Tget_create_plist(hid_t dtype_id) done: if(ret_value < 0) if(new_tcpl_id > 0) - (void)H5I_dec_ref(new_tcpl_id); + (void)H5I_dec_ref(new_tcpl_id, TRUE); FUNC_LEAVE_API(ret_value) } /* end H5Tget_create_plist() */ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index dc7ae23..9dd426e 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -217,7 +217,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number") if ((memb_dt=H5T_get_member_type(dt, membno, H5T_COPY_REOPEN))==NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type") - if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt)) < 0) + if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom") done: diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 7803d07..a11f152 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1781,13 +1781,13 @@ H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) } if (src2dst[i]>=0) { type = H5T_copy (src->shared->u.compnd.memb[i].type, H5T_COPY_ALL); - tid = H5I_register (H5I_DATATYPE, type); + tid = H5I_register (H5I_DATATYPE, type, FALSE); assert (tid>=0); priv->src_memb_id[i] = tid; type = H5T_copy (dst->shared->u.compnd.memb[src2dst[i]].type, H5T_COPY_ALL); - tid = H5I_register (H5I_DATATYPE, type); + tid = H5I_register (H5I_DATATYPE, type, FALSE); assert (tid>=0); priv->dst_memb_id[src2dst[i]] = tid; } @@ -2890,8 +2890,8 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (NULL==(tpath=H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes"); } else if (!H5T_path_noop(tpath)) { - if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL)))<0 || - (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL)))<0) + if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE))<0 || + (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), FALSE))<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); } else noop_conv=TRUE; @@ -3074,9 +3074,9 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Release the temporary datatype IDs used */ if (tsrc_id >= 0) - H5I_dec_ref(tsrc_id); + H5I_dec_ref(tsrc_id, FALSE); if (tdst_id >= 0) - H5I_dec_ref(tdst_id); + H5I_dec_ref(tdst_id, FALSE); break; default: /* Some other command we don't know about yet.*/ @@ -3195,8 +3195,8 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") } else if (!H5T_path_noop(tpath)) { - if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL))) < 0 || - (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL))) < 0) + if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || + (tdst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") } @@ -3226,9 +3226,9 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Release the temporary datatype IDs used */ if(tsrc_id >= 0) - H5I_dec_ref(tsrc_id); + H5I_dec_ref(tsrc_id, FALSE); if(tdst_id >= 0) - H5I_dec_ref(tdst_id); + H5I_dec_ref(tdst_id, FALSE); break; default: /* Some other command we don't know about yet.*/ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 64386b1..df6238c 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -210,7 +210,7 @@ H5Topen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") /* Register the type and return the ID */ - if((ret_value = H5I_register(H5I_DATATYPE, type)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") done: diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 5ab6964..f955a7e 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -94,7 +94,7 @@ H5Tenum_create(hid_t parent_id) if((dt=H5T_enum_create(parent))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type") /* Atomize the type */ - if ((ret_value=H5I_register(H5I_DATATYPE, dt))<0) + if ((ret_value=H5I_register(H5I_DATATYPE, dt, TRUE))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom") done: diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 0deba66..f347d93 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -118,7 +118,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) if((new_dt = H5T_get_native_type(dt, direction, NULL, NULL, &comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type") - if((ret_value=H5I_register(H5I_DATATYPE, new_dt)) < 0) + if((ret_value=H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") done: @@ -343,9 +343,9 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed") - if((super_type_id=H5I_register(H5I_DATATYPE, super_type))<0) + if((super_type_id=H5I_register(H5I_DATATYPE, super_type, FALSE))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype") - if((nat_super_type_id=H5I_register(H5I_DATATYPE, nat_super_type))<0) + if((nat_super_type_id=H5I_register(H5I_DATATYPE, nat_super_type, FALSE))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype") /* Allocate room for the enum values */ diff --git a/src/H5Toh.c b/src/H5Toh.c index 2a4ee86..1ab95f2 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -46,7 +46,8 @@ /********************/ static htri_t H5O_dtype_isa(H5O_t *loc); -static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t dxpl_id); +static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, + hbool_t app_ref); static void *H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); static H5O_loc_t *H5O_dtype_get_oloc(hid_t obj_id); @@ -127,7 +128,7 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t app_ref) { H5T_t *type = NULL; /* Datatype opened */ hid_t ret_value; /* Return value */ @@ -141,7 +142,7 @@ H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t dxpl_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Register an ID for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index bbc698f..0404707 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -123,7 +123,7 @@ H5Tvlen_create(hid_t base_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location") /* Atomize the type */ - if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: @@ -518,7 +518,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ - if ((space_id=H5I_register (H5I_DATASPACE, space))<0) { + if ((space_id=H5I_register (H5I_DATASPACE, space, FALSE))<0) { (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ @@ -552,7 +552,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty /* Check return value */ if(status<=0) { /* We're leaving, so close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") /* Indicate filter can't apply to this combination of parameters */ @@ -573,7 +573,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty /* Make callback to filter's "set local" function */ if((fclass->set_local)(dcpl_id, type_id, space_id)<0) { /* We're leaving, so close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") /* Indicate error during filter callback */ @@ -589,7 +589,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty } /* end for */ /* Close dataspace */ - if(H5I_dec_ref(space_id)<0) + if(H5I_dec_ref(space_id, FALSE)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") } /* end if */ } /* end if */ diff --git a/src/H5detect.c b/src/H5detect.c index 11a4d47..35cca1a 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -621,7 +621,7 @@ H5TN_init_interface(void)\n\ /* Atomize the type */ printf("\ - if ((H5T_NATIVE_%s_g = H5I_register (H5I_DATATYPE, dt))<0)\n\ + if ((H5T_NATIVE_%s_g = H5I_register (H5I_DATATYPE, dt, FALSE))<0)\n\ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL,\"can't initialize type system (atom registration failure\");\n", d[i].varname); printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", |