summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-18 03:01:34 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-18 03:01:34 (GMT)
commit3a6ad029167de727ed9d1879d45eba319a91e375 (patch)
treea478d8682e5b9fe97cf0e10301e74ca5af17820d /tools/h5diff
parent1e1bcb801cb2b569ffa2a94cce2433da2917d919 (diff)
downloadhdf5-3a6ad029167de727ed9d1879d45eba319a91e375.zip
hdf5-3a6ad029167de727ed9d1879d45eba319a91e375.tar.gz
hdf5-3a6ad029167de727ed9d1879d45eba319a91e375.tar.bz2
[svn-r15901] undo some changes in the list of parameters of parse_command_line (forgot that this function is called both on serial and parallel)
tested: linux
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/h5diff_common.c32
-rw-r--r--tools/h5diff/h5diff_common.h2
-rw-r--r--tools/h5diff/h5diff_main.c36
3 files changed, 32 insertions, 38 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index a698921..5a59215 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -55,12 +55,21 @@ static struct long_options l_opts[] = {
void parse_command_line(int argc,
const char* argv[],
+ const char** fname1,
+ const char** fname2,
+ const char** objname1,
+ const char** objname2,
diff_opt_t* options)
{
int opt;
-
+ /* process the command-line */
+ memset(options, 0, sizeof (diff_opt_t));
+
+ /* assume equal contents initially */
+ options->contents = 1;
+
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
@@ -132,10 +141,29 @@ void parse_command_line(int argc,
h5diff_exit(EXIT_FAILURE);
}
-
+ *fname1 = argv[ opt_ind ];
+ *fname2 = argv[ opt_ind + 1 ];
+ *objname1 = argv[ opt_ind + 2 ];
+
+ if ( *objname1 == NULL )
+ {
+ *objname2 = NULL;
+ return;
+ }
+
+ if ( argv[ opt_ind + 3 ] != NULL)
+ {
+ *objname2 = argv[ opt_ind + 3 ];
+ }
+ else
+ {
+ *objname2 = *objname1;
+ }
+
}
+
/*-------------------------------------------------------------------------
* Function: print_info
*
diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h
index b5d83e2..2796bd5 100644
--- a/tools/h5diff/h5diff_common.h
+++ b/tools/h5diff/h5diff_common.h
@@ -17,7 +17,7 @@ extern unsigned char g_Parallel;
extern int g_nTasks;
void usage(void);
-void parse_command_line(int argc, const char* argv[], diff_opt_t* options);
+void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options);
void h5diff_exit(int status);
void print_info(diff_opt_t* options);
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index 7de3c0c..822d59c 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -79,45 +79,11 @@ int main(int argc, const char *argv[])
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, &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;
- }
+ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
/*-------------------------------------------------------------------------
* do the diff