summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5diff.c')
-rw-r--r--tools/lib/h5diff.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index c2153e5..b22af18 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -280,7 +280,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
/* init */
trav_table_init(&table);
if (table == NULL) {
- H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create traverse table");
+ H5TOOLS_INFO(H5E_tools_min_info_id_g, "Cannot create traverse table");
HGOTO_DONE(-1);
}
/*
@@ -440,7 +440,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata)
trav_grp_objs,trav_grp_symlinks, tinfo, H5O_INFO_BASIC) < 0) {
parallel_print("Error: Could not get file contents\n");
opts->err_stat = 1;
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents");
+ H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents");
}
break;
@@ -472,7 +472,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata)
trav_grp_objs,trav_grp_symlinks, tinfo, H5O_INFO_BASIC) < 0) {
parallel_print("Error: Could not get file contents\n");
opts->err_stat = 1;
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents\n");
+ H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents\n");
}
break;
@@ -482,7 +482,7 @@ trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata)
default:
parallel_print("Error: Invalid link type\n");
opts->err_stat = 1;
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Invalid link type");
+ H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Invalid link type");
break;
} /* end of switch */
@@ -564,14 +564,14 @@ h5diff(const char *fname1,
/* open file 1 */
if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
parallel_print("h5diff: <%s>: unable to open file\n", fname1);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1);
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1);
} /* end if */
/* open file 2 */
if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
parallel_print("h5diff: <%s>: unable to open file\n", fname2);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2);
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2);
} /* end if */
/*-------------------------------------------------------------------------
@@ -589,11 +589,11 @@ h5diff(const char *fname1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj1fullname, "/%s", objname1) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
#else /* H5_HAVE_ASPRINTF */
/* (malloc 2 more for "/" and end-of-line) */
if ((obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2)) == NULL)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
HDstrcpy(obj1fullname, "/");
HDstrcat(obj1fullname, objname1);
@@ -607,11 +607,11 @@ h5diff(const char *fname1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj2fullname, "/%s", objname2) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
#else /* H5_HAVE_ASPRINTF */
/* (malloc 2 more for "/" and end-of-line) */
if ((obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2)) == NULL)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
HDstrcpy(obj2fullname, "/");
HDstrcat(obj2fullname, objname2);
#endif /* H5_HAVE_ASPRINTF */
@@ -630,12 +630,12 @@ h5diff(const char *fname1,
/* check if link itself exist */
if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) {
parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
}
/* get info from link */
if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) {
parallel_print("Unable to get link info from <%s>\n", obj1fullname);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
}
info1_lp = info1_obj;
@@ -651,7 +651,7 @@ h5diff(const char *fname1,
if(H5Oget_info_by_name2(file1_id, obj1fullname, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) {
parallel_print("Error: Could not get file contents\n");
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
}
obj1type = (h5trav_type_t)oinfo1.type;
trav_info_add(info1_obj, obj1fullname, obj1type);
@@ -680,12 +680,12 @@ h5diff(const char *fname1,
/* check if link itself exist */
if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) {
parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found");
}
/* get info from link */
if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) {
parallel_print("Unable to get link info from <%s>\n", obj2fullname);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed");
}
info2_lp = info2_obj;
@@ -701,7 +701,7 @@ h5diff(const char *fname1,
if(H5Oget_info_by_name2(file2_id, obj2fullname, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) {
parallel_print("Error: Could not get file contents\n");
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents");
}
obj2type = (h5trav_type_t)oinfo2.type;
trav_info_add(info2_obj, obj2fullname, obj2type);
@@ -753,7 +753,7 @@ h5diff(const char *fname1,
/* treat dangling link as error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
}
else {
if(opts->m_verbose)
@@ -767,7 +767,7 @@ h5diff(const char *fname1,
}
else if(l_ret1 < 0) { /* fail */
parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
}
else if(l_ret1 != 2) { /* symbolic link */
obj1type = (h5trav_type_t)trg_linfo1.trg_type;
@@ -794,7 +794,7 @@ h5diff(const char *fname1,
/* treat dangling link as error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error");
}
else {
if(opts->m_verbose)
@@ -808,7 +808,7 @@ h5diff(const char *fname1,
}
else if(l_ret2 < 0) { /* fail */
parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found");
}
else if(l_ret2 != 2) { /* symbolic link */
obj2type = (h5trav_type_t)trg_linfo2.trg_type;
@@ -852,7 +852,7 @@ h5diff(const char *fname1,
if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE,
trav_grp_objs, trav_grp_symlinks, info1_grp, H5O_INFO_BASIC) < 0) {
parallel_print("Error: Could not get file contents\n");
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
}
info1_lp = info1_grp;
@@ -866,7 +866,7 @@ h5diff(const char *fname1,
if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE,
trav_grp_objs, trav_grp_symlinks, info2_grp, H5O_INFO_BASIC) < 0) {
parallel_print("Error: Could not get file contents\n");
- HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents");
} /* end if */
info2_lp = info2_grp;
}
@@ -1055,11 +1055,11 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) {
- HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
}
#else /* H5_HAVE_ASPRINTF */
if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
- HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
}
else {
HDstrcpy(obj1_fullpath, grp1_path);
@@ -1072,11 +1072,11 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
#ifdef H5_HAVE_ASPRINTF
/* Use the asprintf() routine, since it does what we're trying to do below */
if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) {
- HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
}
#else /* H5_HAVE_ASPRINTF */
if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) {
- HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
+ H5TOOLS_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed");
}
else {
HDstrcpy(obj2_fullpath, grp2_path);
@@ -1416,7 +1416,7 @@ diff(hid_t file1_id,
/* target object1 - get type and name */
if ((status = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
/* dangling link */
if (status == 0) {
@@ -1424,7 +1424,7 @@ diff(hid_t file1_id,
/* dangling link is error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", path1);
- HGOTO_ERROR(1, H5E_tools_min_id_g, "dangling link is error");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "dangling link is error");
}
else
is_dangle_link1 = TRUE;
@@ -1432,14 +1432,14 @@ diff(hid_t file1_id,
/* target object2 - get type and name */
if ((status = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed");
/* dangling link */
if (status == 0) {
if (opts->no_dangle_links) {
/* dangling link is error */
if(opts->m_verbose)
parallel_print("Warning: <%s> is a dangling link.\n", path2);
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error");
+ H5TOOLS_GOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error");
}
else
is_dangle_link2 = TRUE;
@@ -1534,9 +1534,9 @@ diff(hid_t file1_id,
*/
case H5TRAV_TYPE_DATASET:
if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed");
/* verbose (-v) and report (-r) mode */
if(opts->m_verbose || opts->m_report) {
do_print_objname("dataset", path1, path2, opts);
@@ -1569,9 +1569,9 @@ diff(hid_t file1_id,
if(H5Dclose(dset1_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
if(H5Dclose(dset2_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed");
break;
/*----------------------------------------------------------------------
@@ -1580,12 +1580,12 @@ diff(hid_t file1_id,
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
if((type1_id = H5Topen2(file1_id, path1, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed");
if((status = H5Tequal(type1_id, type2_id)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tequal failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Tequal failed");
/* if H5Tequal is > 0 then the datatypes refer to the same datatype */
nfound = (status > 0) ? 0 : 1;
@@ -1607,9 +1607,9 @@ diff(hid_t file1_id,
nfound += diff_attr(type1_id, type2_id, path1, path2, opts);
if(H5Tclose(type1_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
if(H5Tclose(type2_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed");
break;
/*----------------------------------------------------------------------
@@ -1625,9 +1625,9 @@ diff(hid_t file1_id,
print_found(nfound);
if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
/*-----------------------------------------------------------------
* compare attributes
@@ -1639,9 +1639,9 @@ diff(hid_t file1_id,
nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts);
if(H5Gclose(grp1_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
if(H5Gclose(grp2_id) < 0)
- HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
+ H5TOOLS_GOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed");
break;