| 53 |
|
|
| 54 |
|
VIEW midview = STDVIEW; |
| 55 |
|
|
| 56 |
+ |
int wrongformat = 0; |
| 57 |
|
|
| 58 |
+ |
|
| 59 |
|
main(argc, argv) |
| 60 |
|
int argc; |
| 61 |
|
char *argv[]; |
| 91 |
|
exit(1); |
| 92 |
|
} |
| 93 |
|
/* read header */ |
| 94 |
< |
getheader(stdin, headline); |
| 94 |
> |
getheader(stdin, headline, NULL); |
| 95 |
> |
if (wrongformat) { |
| 96 |
> |
fprintf(stderr, "%s: bad input format\n", progname); |
| 97 |
> |
exit(1); |
| 98 |
> |
} |
| 99 |
|
if (print_header) { /* add to header */ |
| 100 |
|
printargs(i, argv, stdout); |
| 101 |
|
putchar('\n'); |
| 102 |
|
} |
| 103 |
|
/* set view */ |
| 104 |
|
if (setview(&midview) != NULL) { |
| 105 |
< |
fprintf(stderr, "%s: bad view information in input\n"); |
| 105 |
> |
fprintf(stderr, "%s: bad view information in input\n", |
| 106 |
> |
progname); |
| 107 |
|
exit(1); |
| 108 |
|
} |
| 109 |
|
/* get findglare data */ |
| 126 |
|
headline(s) /* get line from header */ |
| 127 |
|
char *s; |
| 128 |
|
{ |
| 129 |
+ |
char fmt[32]; |
| 130 |
+ |
|
| 131 |
|
if (print_header) /* copy to output */ |
| 132 |
|
fputs(s, stdout); |
| 133 |
|
if (!strncmp(s, VIEWSTR, VIEWSTRL)) |
| 134 |
|
sscanview(&midview, s+VIEWSTRL); |
| 135 |
+ |
else if (isformat(s)) { |
| 136 |
+ |
formatval(fmt, s); |
| 137 |
+ |
wrongformat = strcmp(fmt, "ASCII"); |
| 138 |
+ |
} |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
|