diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-11-07 15:48:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-11-07 15:49:11 (GMT) |
commit | 6b927a773c83bedc111dcd2ad38805f974660b15 (patch) | |
tree | 5f836ff5409d5265161b058e75f4d806c8afff1d /tools/src/h5repack/h5repack_refs.c | |
parent | 2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb (diff) | |
download | hdf5-6b927a773c83bedc111dcd2ad38805f974660b15.zip hdf5-6b927a773c83bedc111dcd2ad38805f974660b15.tar.gz hdf5-6b927a773c83bedc111dcd2ad38805f974660b15.tar.bz2 |
HDFFV-10876 Update h5dump and h5ls for new ref api.
Diffstat (limited to 'tools/src/h5repack/h5repack_refs.c')
-rw-r--r-- | tools/src/h5repack/h5repack_refs.c | 148 |
1 files changed, 74 insertions, 74 deletions
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index bfc376f..52917fb 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -22,7 +22,7 @@ */ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); -static int copy_refs_attr(hid_t loc_in, hid_t loc_out, +static int copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout); static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, void *ref_out, trav_table_t *travt); @@ -42,7 +42,7 @@ int do_copy_refobjs(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: H5TOOLS_ERR_INIT(int, SUCCEED) */ hid_t grp_in = -1; /* read group ID */ hid_t grp_out = -1; /* write group ID */ hid_t dset_in = -1; /* read dataset ID */ @@ -76,18 +76,18 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if((grp_out = H5Gopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); if(H5Gclose(grp_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if(H5Gclose(grp_in) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); /*------------------------------------------------------------------------- * check for hard links @@ -104,26 +104,26 @@ int do_copy_refobjs(hid_t fidin, */ case H5TRAV_TYPE_DATASET: if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); if((space_id = H5Dget_space(dset_in)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if((ftype_id = H5Dget_type(dset_in)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((rank = H5Sget_simple_extent_ndims(space_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); if(H5Sget_simple_extent_dims(space_id, dims, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); nelmts = 1; for(k = 0; k < rank; k++) nelmts *= dims[k]; if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that @@ -159,15 +159,15 @@ int do_copy_refobjs(hid_t fidin, buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf==NULL) { HDprintf("cannot read into memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); refbuf = (hobj_ref_t*) HDcalloc((unsigned)nelmts, msize); if(refbuf == NULL){ HDprintf("cannot allocate memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ for(u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { @@ -181,7 +181,7 @@ int do_copy_refobjs(hid_t fidin, if((refname = MapIdToName(refobj_id, travt)) != NULL) { /* create the reference, -1 parameter for objects */ if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); if(options->verbose) { HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name ); HDprintf("object <%s> object reference created to <%s>\n", @@ -199,10 +199,10 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); if(buf) HDfree(buf); @@ -213,7 +213,7 @@ int do_copy_refobjs(hid_t fidin, * copy attrs *----------------------------------------------------*/ if(copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); } /*H5T_STD_REF_OBJ*/ /*------------------------------------------------------------------------- @@ -235,10 +235,10 @@ int do_copy_refobjs(hid_t fidin, buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { HDprintf("cannot read into memory\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /*------------------------------------------------------------------------- * create output @@ -247,7 +247,7 @@ int do_copy_refobjs(hid_t fidin, refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { HDprintf("cannot allocate memory\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ for(u = 0; u < nelmts; u++) { @@ -263,13 +263,13 @@ int do_copy_refobjs(hid_t fidin, hid_t region_id = -1; /* region id of the referenced dataset */ if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); /* create the reference, we need the space_id */ if(H5Rcreate(&refbuf[u], fidout, refname, H5R_DATASET_REGION, region_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); if(H5Sclose(region_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); if(options->verbose) { HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name ); HDprintf("object <%s> region reference created to <%s>\n", @@ -287,10 +287,10 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); if(buf) HDfree(buf); @@ -301,7 +301,7 @@ int do_copy_refobjs(hid_t fidin, * copy attrs *----------------------------------------------------*/ if(copy_attr(dset_in, dset_out, &named_dt_head, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); } /* H5T_STD_REF_DSETREG */ /*------------------------------------------------------------------------- * not references, open previously created object in 1st traversal @@ -309,7 +309,7 @@ int do_copy_refobjs(hid_t fidin, */ else { if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); } /* end else */ /*------------------------------------------------------------------------- @@ -317,7 +317,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); /*------------------------------------------------------------------------- * check for hard links @@ -328,7 +328,7 @@ int do_copy_refobjs(hid_t fidin, H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); if(H5Dclose(dset_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); } /*can_read*/ /*------------------------------------------------------------------------- @@ -336,15 +336,15 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(mtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Pclose(dcpl_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); if(H5Sclose(space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); if(H5Dclose(dset_in) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); break; /*------------------------------------------------------------------------- @@ -353,9 +353,9 @@ int do_copy_refobjs(hid_t fidin, */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); if(H5Tclose(type_in) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); break; /*------------------------------------------------------------------------- @@ -368,7 +368,7 @@ int do_copy_refobjs(hid_t fidin, case H5TRAV_TYPE_UNKNOWN: case H5TRAV_TYPE_UDLINK: - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5TRAV invalid type"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5TRAV invalid type"); default: break; @@ -429,7 +429,7 @@ static int copy_refs_attr(hid_t loc_in, trav_table_t *travt, hid_t fidout) /* for saving references */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: H5TOOLS_ERR_INIT(int, SUCCEED) */ hid_t attr_id = -1; /* attr ID */ hid_t attr_out = -1; /* attr ID */ hid_t space_id = -1; /* space ID */ @@ -455,26 +455,26 @@ static int copy_refs_attr(hid_t loc_in, if(H5Oget_info2(loc_in, &oinfo, H5O_INFO_NUM_ATTRS) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; /* open attribute */ if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed"); /* get the file datatype */ if((ftype_id = H5Aget_type(attr_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type failed"); type_class = H5Tget_class(ftype_id); if((mtype_id = H5Tget_native_type(ftype_id, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((msize = H5Tget_size(mtype_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); is_ref = (type_class == H5T_REFERENCE); @@ -498,7 +498,7 @@ static int copy_refs_attr(hid_t loc_in, int nmembers = H5Tget_nmembers(ftype_id) ; if (nmembers < 1) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); ref_comp_index = (unsigned *)HDmalloc((size_t)nmembers*sizeof(unsigned)); ref_comp_size = (size_t *)HDmalloc((size_t)nmembers*sizeof(ref_comp_size)); @@ -546,15 +546,15 @@ static int copy_refs_attr(hid_t loc_in, /* get name */ if(H5Aget_name(attr_id, 255, name) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name failed"); /* get the dataspace handle */ if((space_id = H5Aget_space(attr_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_space failed"); /* get dimensions */ if((rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /*------------------------------------------------------------------------- @@ -583,7 +583,7 @@ static int copy_refs_attr(hid_t loc_in, } if((attr_out = H5Acreate2(loc_out, name, ftype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed"); if (nelmts>0) { /* handle object references */ @@ -591,15 +591,15 @@ static int copy_refs_attr(hid_t loc_in, buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { HDprintf("cannot read into memory\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); if(refbuf == NULL) { HDprintf("cannot allocate memory\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ for(i = 0; i < (unsigned)nelmts; i++) @@ -612,10 +612,10 @@ static int copy_refs_attr(hid_t loc_in, if(buf == NULL) { HDprintf( "cannot read into memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); /*------------------------------------------------------------------------- * create output @@ -624,7 +624,7 @@ static int copy_refs_attr(hid_t loc_in, refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { HDprintf( "cannot allocate memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ for(i = 0; i < (unsigned)nelmts; i++) @@ -639,11 +639,11 @@ static int copy_refs_attr(hid_t loc_in, if(buf == NULL) { HDprintf( "cannot read into memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); if (H5R_OBJ_REF_BUF_SIZE==msize) { hobj_ref_t ref_out; @@ -680,11 +680,11 @@ static int copy_refs_attr(hid_t loc_in, if(buf == NULL) { HDprintf( "cannot read into memory\n" ); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); for (i=0; i<(unsigned)nelmts; i++) { for (j=0; j<(unsigned)ref_comp_field_n; j++) { @@ -709,7 +709,7 @@ static int copy_refs_attr(hid_t loc_in, } /* else if (is_ref_comp) */ if(H5Awrite(attr_out, mtype_id, refbuf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed"); if (is_ref_vlen && buf) H5Treclaim (mtype_id, space_id, H5P_DEFAULT, buf); @@ -739,20 +739,20 @@ static int copy_refs_attr(hid_t loc_in, } if(H5Aclose(attr_out) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ if(H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(mtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Sclose(space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); if(H5Aclose(attr_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* for(u = 0; u < (unsigned)oinfo.num_attrs; u++) */ done: @@ -822,27 +822,27 @@ out: static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, void *ref_out, trav_table_t *travt) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: H5TOOLS_ERR_INIT(int, SUCCEED) */ const char *ref_obj_name; hid_t space_id = -1; hid_t ref_obj_id = -1; ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in); if (ref_obj_id < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rdereference2 failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rdereference2 failed"); ref_obj_name = MapIdToName(ref_obj_id, travt); if (ref_obj_name == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "MapIdToName failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "MapIdToName failed"); if (ref_type == H5R_DATASET_REGION) { space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in); if (space_id < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); } if(H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); + H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); done: H5E_BEGIN_TRY { |