summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diff_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff/h5diff_common.c')
-rw-r--r--tools/h5diff/h5diff_common.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 05111a9..fc073a9 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -54,24 +54,24 @@ static struct long_options l_opts[] = {
*-------------------------------------------------------------------------
*/
-void parse_command_line(int argc,
- const char* argv[],
- const char** fname1,
+void parse_command_line(int argc,
+ const char* argv[],
+ const char** fname1,
const char** fname2,
- const char** objname1,
- const char** objname2,
+ const char** objname1,
+ const char** objname2,
diff_opt_t* options)
{
-
+
int opt;
/* process the command-line */
memset(options, 0, sizeof (diff_opt_t));
-
+
/* parse command line options */
- while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
+ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
- switch ((char)opt)
+ switch ((char)opt)
{
default:
usage();
@@ -97,7 +97,7 @@ void parse_command_line(int argc,
break;
case 'd':
options->d=1;
-
+
if ( check_d_input( opt_arg )==-1)
{
printf("<-d %s> is not a valid option\n", opt_arg );
@@ -108,7 +108,7 @@ void parse_command_line(int argc,
break;
case 'p':
-
+
options->p=1;
if ( check_p_input( opt_arg )==-1)
{
@@ -120,7 +120,7 @@ void parse_command_line(int argc,
break;
case 'n':
-
+
options->n=1;
if ( check_n_input( opt_arg )==-1)
{
@@ -129,13 +129,13 @@ void parse_command_line(int argc,
h5diff_exit(EXIT_FAILURE);
}
options->count = atol( opt_arg );
-
+
break;
}
}
-
+
/* check for file names to be processed */
- if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL)
+ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL)
{
error_msg(progname, "missing file names\n");
usage();
@@ -152,7 +152,7 @@ void parse_command_line(int argc,
return;
}
- if ( argv[ opt_ind + 3 ] != NULL)
+ if ( argv[ opt_ind + 3 ] != NULL)
{
*objname2 = argv[ opt_ind + 3 ];
}
@@ -161,7 +161,7 @@ void parse_command_line(int argc,
*objname2 = *objname1;
}
-
+
}
/*-------------------------------------------------------------------------
@@ -176,14 +176,14 @@ void parse_command_line(int argc,
{
if (options->m_quiet || options->err_stat || options->m_contents)
return;
-
+
if (options->cmn_objs==0)
{
printf("No common objects found. Files are not comparable.\n");
if (!options->m_verbose)
printf("Use -v for a list of objects.\n");
}
-
+
if (options->not_cmp==1)
{
printf("--------------------------------\n");
@@ -192,7 +192,7 @@ void parse_command_line(int argc,
if (!options->m_verbose)
printf("Use -v for a list of objects.\n");
}
-
+
}
/*-------------------------------------------------------------------------
@@ -216,7 +216,7 @@ int check_n_input( const char *str )
{
unsigned i;
char c;
-
+
for ( i = 0; i < strlen(str); i++)
{
c = str[i];
@@ -250,18 +250,18 @@ int check_n_input( const char *str )
int check_p_input( const char *str )
{
double x;
-
+
/*
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
if (strlen(str)>2 && str[0]=='0' && str[1]=='x')
return -1;
-
+
x=atof(str);
if (x<=0)
return -1;
-
+
return 1;
}
@@ -283,18 +283,18 @@ int check_p_input( const char *str )
int check_d_input( const char *str )
{
double x;
-
+
/*
the atof return value on a hexadecimal input is different
on some systems; we do a character check for this
*/
if (strlen(str)>2 && str[0]=='0' && str[1]=='x')
return -1;
-
+
x=atof(str);
if (x <=0)
return -1;
-
+
return 1;
}
@@ -329,7 +329,7 @@ void usage(void)
printf(" -n C, --count=C Print differences up to C number\n");
printf(" -d D, --delta=D Print difference when greater than limit D\n");
printf(" -p R, --relative=R Print difference when greater than relative limit R\n");
-
+
printf("\n");
@@ -356,7 +356,7 @@ void usage(void)
printf(" when the -c flag is present, (contents mode) the objects in file1\n");
printf(" must match exactly the objects in file2\n");
printf("\n");
-
+
printf(" The compare criteria is:\n");
printf(" 1) datasets: numerical array differences 2) groups: name string difference\n");
printf(" 3) datatypes: the return value of H5Tequal 2) links: name string difference\n");