diff options
Diffstat (limited to 'tools/h5diff/h5diff_main.c')
-rw-r--r-- | tools/h5diff/h5diff_main.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index c383933..f009651 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 @@ -69,15 +71,59 @@ 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; + /*------------------------------------------------------------------------- + * initialize options + *------------------------------------------------------------------------- + */ + + /* zero defaults */ + memset(&options, 0, sizeof (diff_opt_t)); + + /* assume equal contents initially */ + options.contents = 1; + + /*------------------------------------------------------------------------- + * process the command-line + *------------------------------------------------------------------------- + */ + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + /*------------------------------------------------------------------------- + * file and object names + *------------------------------------------------------------------------- + */ + + fname1 = argv[ opt_ind ]; + fname2 = argv[ opt_ind + 1 ]; + objname1 = argv[ opt_ind + 2 ]; + + if ( objname1 == NULL ) + { + objname2 = NULL; + } + + if ( argv[ opt_ind + 3 ] != NULL) + { + objname2 = argv[ opt_ind + 3 ]; + } + else + { + objname2 = objname1; + } + + /*------------------------------------------------------------------------- + * do the diff + *------------------------------------------------------------------------- + */ + nfound = h5diff(fname1,fname2,objname1,objname2,&options); print_info(&options); |