| 31 |
|
|
| 32 |
|
int nfiles; /* number of input files */ |
| 33 |
|
|
| 34 |
+ |
VIEW commvw; /* common view parameters */ |
| 35 |
+ |
|
| 36 |
|
char ourfmt[LPICFMT+1] = PICFMT; /* input picture format */ |
| 37 |
|
|
| 38 |
|
char StandardInput[] = "<stdin>"; |
| 193 |
|
init(); /* set constants */ |
| 194 |
|
/* go back and get expressions */ |
| 195 |
|
for (a = 1; a < argc; a++) { |
| 196 |
+ |
char *fpath; |
| 197 |
|
if (argv[a][0] == '-') |
| 198 |
|
switch (argv[a][1]) { |
| 199 |
|
case 'x': |
| 207 |
|
case 'h': |
| 208 |
|
continue; |
| 209 |
|
case 'f': |
| 210 |
< |
fcompile(argv[++a]); |
| 210 |
> |
fpath = getpath(argv[++a], getrlibpath(), 0); |
| 211 |
> |
if (fpath == NULL) { |
| 212 |
> |
eputs(argv[0]); |
| 213 |
> |
eputs(": cannot find file '"); |
| 214 |
> |
eputs(argv[a]); |
| 215 |
> |
eputs("'\n"); |
| 216 |
> |
quit(1); |
| 217 |
> |
} |
| 218 |
> |
fcompile(fpath); |
| 219 |
|
continue; |
| 220 |
|
case 'e': |
| 221 |
|
scompile(argv[++a], NULL, 0); |
| 223 |
|
} |
| 224 |
|
break; |
| 225 |
|
} |
| 226 |
< |
/* set/get output resolution */ |
| 216 |
< |
if (!vardefined(vxres)) |
| 217 |
< |
varset(vxres, ':', (double)xmax); |
| 218 |
< |
if (!vardefined(vyres)) |
| 219 |
< |
varset(vyres, ':', (double)ymax); |
| 226 |
> |
/* get output resolution */ |
| 227 |
|
xres = varvalue(vxres) + .5; |
| 228 |
|
yres = varvalue(vyres) + .5; |
| 229 |
|
if (xres <= 0 || yres <= 0) { |
| 233 |
|
} |
| 234 |
|
/* complete header */ |
| 235 |
|
printargs(argc, argv, stdout); |
| 236 |
+ |
if (commvw.type) { |
| 237 |
+ |
fputs(VIEWSTR, stdout); |
| 238 |
+ |
fprintview(&commvw, stdout); |
| 239 |
+ |
fputc('\n', stdout); |
| 240 |
+ |
} |
| 241 |
|
if (strcmp(ourfmt, PICFMT)) |
| 242 |
|
fputformat(ourfmt, stdout); /* print format if known */ |
| 243 |
|
putchar('\n'); |
| 316 |
|
} |
| 317 |
|
if (!gotview || setview(&input[nfiles].vw) != NULL) |
| 318 |
|
input[nfiles].vw.type = 0; |
| 319 |
+ |
else if (!commvw.type) |
| 320 |
+ |
commvw = input[nfiles].vw; |
| 321 |
|
if (!fgetsresolu(&input[nfiles].rs, input[nfiles].fp)) { |
| 322 |
|
eputs(input[nfiles].name); |
| 323 |
|
eputs(": bad picture size\n"); |
| 385 |
|
ourbright = xyz_bright; |
| 386 |
|
} else |
| 387 |
|
varset(vwhteff, ':', WHTEFFICACY); |
| 388 |
+ |
/* these may be overridden */ |
| 389 |
+ |
varset(vxres, ':', (double)xmax); |
| 390 |
+ |
varset(vyres, ':', (double)ymax); |
| 391 |
|
} |
| 392 |
|
|
| 393 |
|
|