summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diff_common.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-09-17 12:45:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-09-17 12:45:55 (GMT)
commit6747ebd9858374ae912b6182024861b1710518c8 (patch)
tree9bd75142d9dd292fe4272118f650f1c91205a988 /tools/h5diff/h5diff_common.c
parent9de3a84f916168831f29a4259fe93cb4823d8f57 (diff)
downloadhdf5-6747ebd9858374ae912b6182024861b1710518c8.zip
hdf5-6747ebd9858374ae912b6182024861b1710518c8.tar.gz
hdf5-6747ebd9858374ae912b6182024861b1710518c8.tar.bz2
[svn-r19413] Description:
Bring r19349:19411 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.4 (amazon) in debug mode Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'tools/h5diff/h5diff_common.c')
-rw-r--r--tools/h5diff/h5diff_common.c69
1 files changed, 59 insertions, 10 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 9b6037e..a678b2f 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -42,6 +42,7 @@ static struct long_options l_opts[] = {
{ "use-system-epsilon", no_arg, 'e' },
{ "follow-symlinks", no_arg, 'l' },
{ "no-dangling-links", no_arg, 'x' },
+ { "exclude-path", require_arg, 'E' },
{ NULL, 0, '\0' }
};
@@ -64,6 +65,7 @@ void parse_command_line(int argc,
{
int opt;
+ struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node;
/* process the command-line */
memset(options, 0, sizeof (diff_opt_t));
@@ -74,6 +76,9 @@ void parse_command_line(int argc,
/* NaNs are handled by default */
options->do_nans = 1;
+ /* init for exclude-path option */
+ exclude_head = NULL;
+
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
@@ -104,6 +109,35 @@ void parse_command_line(int argc,
case 'x':
options->no_dangle_links = 1;
break;
+ case 'E':
+ options->exclude_path = 1;
+
+ /* create linked list of excluding objects */
+ if( (exclude_node = (struct exclude_path_list*) malloc(sizeof(struct exclude_path_list))) == NULL)
+ {
+ printf("Error: lack of memory!\n");
+ h5diff_exit(EXIT_FAILURE);
+ }
+
+ /* init */
+ exclude_node->obj_path = opt_arg;
+ exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN;
+ exclude_prev = exclude_head;
+
+ if (NULL == exclude_head)
+ {
+ exclude_head = exclude_node;
+ exclude_head->next = NULL;
+ }
+ else
+ {
+ while(NULL != exclude_prev->next)
+ exclude_prev=exclude_prev->next;
+
+ exclude_node->next = NULL;
+ exclude_prev->next = exclude_node;
+ }
+ break;
case 'd':
options->d=1;
@@ -163,6 +197,10 @@ void parse_command_line(int argc,
}
}
+ /* if exclude-path option is used, keep the exclude path list */
+ if (options->exclude_path)
+ options->exclude = exclude_head;
+
/* if use system epsilon, unset -p and -d option */
if (options->use_system_epsilon)
options->d = options->p = 0;
@@ -351,7 +389,7 @@ check_d_input( const char *str )
void usage(void)
{
- printf("usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] \n");
+ printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] \n");
printf(" file1 File name of the first HDF5 file\n");
printf(" file2 File name of the second HDF5 file\n");
printf(" [obj1] Name of an HDF5 object, in absolute path\n");
@@ -425,18 +463,29 @@ void usage(void)
printf("\n");
- printf(" Compare criteria\n");
- printf(" If no objects [obj1[obj2]] are specified, h5diff only compares objects\n");
- printf(" with the same absolute path in both files\n");
+ printf(" File comparison:\n");
+ printf(" If no objects [obj1[ obj2]] are specified, the h5diff comparison proceeds as\n");
+ printf(" a comparison of the two files' root groups. That is, h5diff first compares\n");
+ printf(" the names of root group members, generates a report of root group objects\n");
+ printf(" that appear in only one file or in both files, and recursively compares\n");
+ printf(" common objects.\n");
printf("\n");
- printf(" The compare criteria is:\n");
- printf(" 1) datasets: numerical array differences\n");
- printf(" 2) groups: name string difference\n");
- printf(" 3) datatypes: the return value of H5Tequal\n");
- printf(" 4) links: name string difference of the linked value as default\n");
- printf(" (refer to --follow-symlinks option).\n");
+ printf(" Object comparison:\n");
+ printf(" 1) Groups \n");
+ printf(" First compares the names of member objects (relative path, from the\n");
+ printf(" specified group) and generates a report of objects that appear in only\n");
+ printf(" one group or in both groups. Common objects are then compared recursively.\n");
+ printf(" 2) Datasets \n");
+ printf(" Array rank and dimensions, datatypes, and data values are compared.\n");
+ printf(" 3) Datatypes \n");
+ printf(" The comparison is based on the return value of H5Tequal.\n");
+ printf(" 4) Symbolic links \n");
+ printf(" The paths to the target objects are compared.\n");
+ printf(" (The option --follow-symlinks overrides the default behavior when\n");
+ printf(" symbolic links are compared.).\n");
printf("\n");
+
printf(" Exit code:\n");
printf(" 0 if no differences, 1 if differences found, 2 if error\n");
printf("\n");