18 |
|
|
19 |
|
#include "calcomp.h" |
20 |
|
|
21 |
< |
#define MAXINP 16 /* maximum number of input files */ |
21 |
> |
#define MAXINP 32 /* maximum number of input files */ |
22 |
|
|
23 |
|
struct { |
24 |
|
char *name; /* file name */ |
82 |
|
fcompile(argv[++a]); |
83 |
|
break; |
84 |
|
case 'e': |
85 |
< |
scompile(NULL, argv[++a]); |
85 |
> |
scompile(argv[++a], NULL, 0); |
86 |
|
break; |
87 |
|
default: |
88 |
|
goto usage; |
121 |
|
input[nfiles].name = argv[a]; |
122 |
|
input[nfiles].fp = fopen(argv[a], "r"); |
123 |
|
if (input[nfiles].fp == NULL) { |
124 |
< |
eputs(argv[a]); |
125 |
< |
eputs(": cannot open\n"); |
124 |
> |
perror(argv[a]); |
125 |
|
quit(1); |
126 |
|
} |
127 |
|
} |
128 |
|
fputs(input[nfiles].name, stdout); |
129 |
|
fputs(":\n", stdout); |
130 |
|
getheader(input[nfiles].fp, tputs); |
131 |
< |
if (fscanf(input[nfiles].fp, "-Y %d +X %d\n", &ypos, &xpos) != 2) { |
131 |
> |
if (fgetresolu(&xpos, &ypos, input[nfiles].fp) != |
132 |
> |
(YMAJOR|YDECR)) { |
133 |
|
eputs(input[nfiles].name); |
134 |
|
eputs(": bad picture size\n"); |
135 |
|
quit(1); |
147 |
|
} |
148 |
|
printargs(argc, argv, stdout); |
149 |
|
putchar('\n'); |
150 |
< |
printf("-Y %d +X %d\n", yres, xres); |
150 |
> |
fputresolu(YMAJOR|YDECR, xres, yres, stdout); |
151 |
|
combine(); |
152 |
|
quit(0); |
153 |
|
usage: |
200 |
|
} |
201 |
|
} |
202 |
|
if (fwritescan(scanout, xres, stdout) < 0) { |
203 |
< |
eputs("write error\n"); |
203 |
> |
perror("write error"); |
204 |
|
quit(1); |
205 |
|
} |
206 |
|
} |