Mercurial > hg > wm
comparison Meerwald/cmp_wang_sig.c @ 20:bd669312f068
suppress warnings, fix link errors
author | Peter Meerwald-Stadler <pmeerw@pmeerw.net> |
---|---|
date | Sat, 28 Jan 2023 23:54:58 +0100 |
parents | f83ef905a63d |
children |
comparison
equal
deleted
inserted
replaced
19:0fffb6f03ebf | 20:bd669312f068 |
---|---|
1 #include "wm.h" | 1 #include "wm.h" |
2 | 2 |
3 char *progname; | 3 char *progname; |
4 | 4 |
5 void usage(void) { | 5 void usage(void) { |
6 fprintf(stderr, "usage: %s [-h] [-C] [-o file] [-v n] -s file file\n\n", progname); | 6 fprintf(stderr, "usage: %s [-h] [-o file] [-v n] -s file file\n\n", progname); |
7 fprintf(stderr, "\t-C\t\toutput correlation only\n"); | |
8 fprintf(stderr, "\t-h\t\tprint usage\n"); | 7 fprintf(stderr, "\t-h\t\tprint usage\n"); |
9 fprintf(stderr, "\t-o file\t\toutput file\n"); | 8 fprintf(stderr, "\t-o file\t\toutput file\n"); |
10 fprintf(stderr, "\t-v n\t\tverbosity level\n"); | 9 fprintf(stderr, "\t-v n\t\tverbosity level\n"); |
11 fprintf(stderr, "\t-s file\t\toriginal signature file\n"); | 10 fprintf(stderr, "\t-s file\t\toriginal signature file\n"); |
12 exit(0); | 11 exit(0); |
28 int sig_e, sig_f; | 27 int sig_e, sig_f; |
29 double s1, s2, s3; | 28 double s1, s2, s3; |
30 char line[32]; | 29 char line[32]; |
31 | 30 |
32 int verbose = 0; | 31 int verbose = 0; |
33 int correlation_only = 0; | |
34 | 32 |
35 progname = argv[0]; | 33 progname = argv[0]; |
36 | 34 |
37 while ((c = getopt(argc, argv, "h?Co:s:v:")) != EOF) { | 35 while ((c = getopt(argc, argv, "h?o:s:v:")) != EOF) { |
38 switch (c) { | 36 switch (c) { |
39 case 'h': | 37 case 'h': |
40 case '?': | 38 case '?': |
41 usage(); | 39 usage(); |
42 break; | |
43 case 'C': | |
44 correlation_only = 1; | |
45 break; | 40 break; |
46 case 'o': | 41 case 'o': |
47 if ((out = fopen(optarg, "w")) == NULL) { | 42 if ((out = fopen(optarg, "w")) == NULL) { |
48 fprintf(stderr, "%s: unable to open output file %s\n", progname, optarg); | 43 fprintf(stderr, "%s: unable to open output file %s\n", progname, optarg); |
49 exit(1); | 44 exit(1); |
81 exit(1); | 76 exit(1); |
82 } | 77 } |
83 else | 78 else |
84 strcpy(input_name, argv[0]); | 79 strcpy(input_name, argv[0]); |
85 } | 80 } |
86 | 81 |
87 if (!sig) { | 82 if (!sig) { |
88 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname); | 83 fprintf(stderr, "%s: original signature file not specified, use -s file option\n", progname); |
89 exit(1); | 84 exit(1); |
90 } | 85 } |
91 | 86 |