summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diff_main.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-29 19:47:50 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-29 19:47:50 (GMT)
commit13294e2042f855e92653dc7ca3ff3b5980ee816d (patch)
tree2347a889df8fc5cd37e29ac89124aa52174dc583 /tools/h5diff/h5diff_main.c
parente636e152ea862cb1cb9da3e0141f32ef5459052f (diff)
downloadhdf5-13294e2042f855e92653dc7ca3ff3b5980ee816d.zip
hdf5-13294e2042f855e92653dc7ca3ff3b5980ee816d.tar.gz
hdf5-13294e2042f855e92653dc7ca3ff3b5980ee816d.tar.bz2
[svn-r15988] Merge with 1.8 up to rev 15871
Regarding h5diff, h5copy Tested: linux
Diffstat (limited to 'tools/h5diff/h5diff_main.c')
-rw-r--r--tools/h5diff/h5diff_main.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index f79099e..822d59c 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -13,10 +13,12 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "h5diff.h"
#include <stdlib.h>
#include <assert.h>
+#include <memory.h>
+#include "h5diff.h"
#include "h5diff_common.h"
+#include "h5tools_utils.h"
/*-------------------------------------------------------------------------
* Function: main
@@ -62,12 +64,6 @@
* November 19, 2007
* adopted the syntax h5diff [OPTIONS] file1 file2 [obj1[obj2]]
*
- * Aug 2008
- * Added a "contents" mode check.
- * If this mode is present, objects in both files must match (must be exactly the same)
- * If this does not happen, the tool returns an error code of 1
- * (instead of the success code of 0)
- *
*-------------------------------------------------------------------------
*/
@@ -75,15 +71,25 @@
int main(int argc, const char *argv[])
{
int ret;
- char *fname1 = NULL;
- char *fname2 = NULL;
- char *objname1 = NULL;
- char *objname2 = NULL;
+ const char *fname1 = NULL;
+ const char *fname2 = NULL;
+ const char *objname1 = NULL;
+ const char *objname2 = NULL;
hsize_t nfound=0;
diff_opt_t options;
+ /*-------------------------------------------------------------------------
+ * process the command-line
+ *-------------------------------------------------------------------------
+ */
+
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
+ /*-------------------------------------------------------------------------
+ * do the diff
+ *-------------------------------------------------------------------------
+ */
+
nfound = h5diff(fname1,fname2,objname1,objname2,&options);
print_info(&options);
@@ -96,11 +102,14 @@ int main(int argc, const char *argv[])
ret = (nfound == 0 ? 0 : 1 );
+ /* if graph difference return 1 for differences */
if ( options.contents == 0 )
ret = 1;
- if(options.err_stat)
+ /* and return 2 for error */
+ if (options.err_stat)
ret = 2;
+
return ret;
}