12 |
|
#include <ctype.h> |
13 |
|
|
14 |
|
#include "platform.h" |
15 |
– |
#include "paths.h" |
15 |
|
#include "rtio.h" |
16 |
|
#include "rtmath.h" |
17 |
|
#include "object.h" |
18 |
|
#include "otypes.h" |
19 |
|
|
21 |
– |
#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ |
22 |
– |
#undef getc |
23 |
– |
#define getc getc_unlocked |
24 |
– |
#endif |
25 |
– |
|
20 |
|
int xac; /* global xform argument count */ |
21 |
|
char **xav; /* global xform argument pointer */ |
22 |
|
int xfa; /* start of xf arguments */ |
208 |
|
} |
209 |
|
n = 0; /* count number of lines in file */ |
210 |
|
while (fgetline(argbuf,sizeof(argbuf),argfp) != NULL) |
211 |
< |
n += argbuf[0] && argbuf[0] != '#'; |
211 |
> |
n += (argbuf[0] != '\0') & (argbuf[0] != '#'); |
212 |
|
if (!n) { |
213 |
|
fprintf(stderr, "%s: empty argument file \"%s\"\n", |
214 |
|
av[0], av[fi+1]); |
215 |
|
exit(1); |
216 |
|
} |
223 |
– |
nrept *= n; |
217 |
|
rewind(argfp); |
218 |
|
} |
219 |
+ |
nrept *= n; |
220 |
|
err = 0; k = 0; /* read each arg list and call main */ |
221 |
|
while (fgetline(argbuf,sizeof(argbuf),argfp) != NULL) { |
222 |
< |
if (!argbuf[0] || argbuf[0] == '#') |
222 |
> |
if (!argbuf[0] | (argbuf[0] == '#')) { |
223 |
> |
printf("%s\n", argbuf); |
224 |
|
continue; |
225 |
+ |
} |
226 |
|
avp = newav+2; |
227 |
|
avp[0] = av[0]; |
228 |
|
for (i = 1; i < fi; i++) |
393 |
|
exit(1); |
394 |
|
} |
395 |
|
xform(buf, pin); |
396 |
< |
pclose(pin); |
396 |
> |
if (pclose(pin) != 0) |
397 |
> |
fprintf(stderr, "%s: (%s): warning - bad status from \"%s\"\n", |
398 |
> |
progname, fname, buf); |
399 |
|
} else { |
400 |
|
printf("\n%s", buf); |
401 |
|
if (xac > 1) { |
555 |
|
|
556 |
|
if (readfargs(&fa, fin) != 1) |
557 |
|
return(-1); |
558 |
< |
if (fa.nsargs != 0 || fa.nfargs != 4) |
558 |
> |
if ((fa.nsargs != 0) | (fa.nfargs != 4)) |
559 |
|
return(-1); |
560 |
|
printf("0\n0\n4"); |
561 |
|
printf(" %18.12g %18.12g %18.12g", |
576 |
|
|
577 |
|
if (readfargs(&fa, fin) != 1) |
578 |
|
return(-1); |
579 |
< |
if (fa.nsargs != 0 || fa.nfargs != 7) |
579 |
> |
if ((fa.nsargs != 0) | ( fa.nfargs != 7)) |
580 |
|
return(-1); |
581 |
|
printf("0\n0\n7"); |
582 |
|
printf(" %18.12g %18.12g %18.12g %18.12g\n", |