92 |
|
fputs(progname, stderr); |
93 |
|
fputs(" [-h][-s|-w|-v][-rel min_test][-rms epsilon][-max epsilon] reference test\n", |
94 |
|
stderr); |
95 |
< |
exit(1); |
95 |
> |
exit(2); |
96 |
|
} |
97 |
|
|
98 |
|
/* Get type ID from name (or 0 if not found) */ |
291 |
|
|
292 |
|
/* Compare two sets of header variables */ |
293 |
|
static int |
294 |
< |
headers_match(LUTAB *hp1, LUTAB *hp2) |
294 |
> |
headers_match() |
295 |
|
{ |
296 |
< |
int ne = lu_doall(hp1, match_val, hp2); |
296 |
> |
int ne = lu_doall(&hdr1, match_val, &hdr2); |
297 |
|
if (ne < 0) |
298 |
|
return(0); /* something didn't match! */ |
299 |
|
/* non-fatal if second header has extra */ |
300 |
< |
if (report >= REP_WARN && (ne = lu_doall(hp2, NULL, NULL) - ne)) |
300 |
> |
if (report >= REP_WARN && (ne = lu_doall(&hdr2, NULL, NULL) - ne)) |
301 |
|
printf("%s: warning - '%s' has %d extra header setting(s)\n", |
302 |
|
progname, f2name, ne); |
303 |
|
return(1); /* good match */ |
687 |
|
SET_FILE_BINARY(stdin); /* in case we're using it */ |
688 |
|
if (!f1in && !(f1in = fopen(f1name, "rb"))) { |
689 |
|
fprintf(stderr, "%s: cannot open for reading\n", f1name); |
690 |
< |
return(1); |
690 |
> |
return(2); |
691 |
|
} |
692 |
|
if (!strcmp(f2name, "-")) { |
693 |
|
f2in = stdin; |
694 |
|
f2name = stdin_name; |
695 |
|
} else if (!(f2in = fopen(f2name, "rb"))) { |
696 |
|
fprintf(stderr, "%s: cannot open for reading\n", f2name); |
697 |
< |
return(1); |
697 |
> |
return(2); |
698 |
|
} |
699 |
|
/* load headers */ |
700 |
|
if ((typ1 = identify_type(f1name, f1in, &hdr1)) < 0) |
701 |
< |
return(1); |
701 |
> |
return(2); |
702 |
|
if ((typ2 = identify_type(f2name, f2in, &hdr2)) < 0) |
703 |
< |
return(1); |
703 |
> |
return(2); |
704 |
|
if (typ1 != typ2) { |
705 |
|
if (report != REP_QUIET) |
706 |
|
printf("%s: '%s' is %s and '%s' is %s\n", |
709 |
|
return(1); |
710 |
|
} |
711 |
|
ign_header |= !has_header(typ1); /* check headers if indicated */ |
712 |
< |
if (!ign_header && !headers_match(&hdr1, &hdr2)) |
712 |
> |
if (!ign_header && !headers_match()) |
713 |
|
return(1); |
714 |
|
lu_done(&hdr1); lu_done(&hdr2); |
715 |
|
if (!ign_header & (report >= REP_WARN)) { |