1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <jasper/jasper.h>
4 
5 #define	FAILED	2
6 
main(int argc,char ** argv)7 int main(int argc, char **argv)
8 {
9 	char *refpath;
10 	FILE *reffile;
11 	char *othpath;
12 	FILE *othfile;
13 	int c;
14 	jas_seq2d_t *x;
15 	jas_seq2d_t *y;
16 
17 	refpath = 0;
18 	othpath = 0;
19 
20 	while ((c = getopt(argc, argv, "f:F:")) != EOF) {
21 		switch (c) {
22 		case 'f':
23 			refpath = optarg;
24 			break;
25 		case 'F':
26 			othpath = optarg;
27 			break;
28 		}
29 	}
30 
31 	if (!refpath || !othpath) {
32 		fprintf(stderr, "usage: %s -f reffile -F othfile\n", argv[0]);
33 		exit(FAILED);
34 	}
35 
36 	if (!(reffile = fopen(refpath, "r"))) {
37 		fprintf(stderr, "cannot open %s\n", refpath);
38 		exit(FAILED);
39 	}
40 	if (!(othfile = fopen(othpath, "r"))) {
41 		fprintf(stderr, "cannot open %s\n", othpath);
42 		exit(FAILED);
43 	}
44 
45 	if (!(x = jas_seq2d_input(reffile))) {
46 		fprintf(stderr, "cannot input reference\n");
47 		exit(FAILED);
48 	}
49 	if (!(y = jas_seq2d_input(othfile))) {
50 		fprintf(stderr, "cannot input other\n");
51 		exit(FAILED);
52 	}
53 
54 	if (!jas_matrix_cmp(x, y)) {
55 		fprintf(stderr, "equal\n");
56 		exit(0);
57 	} else {
58 		fprintf(stderr, "not equal\n");
59 		exit(1);
60 	}
61 
62 	exit(FAILED);
63 
64 }
65 
66