| 1 |
greg |
1.1 |
#ifndef lint |
| 2 |
greg |
2.28 |
static const char RCSid[] = "$Id: pcompos.c,v 2.27 2004/01/02 12:47:01 schorsch Exp $"; |
| 3 |
greg |
1.1 |
#endif |
| 4 |
|
|
/* |
| 5 |
|
|
* pcompos.c - program to composite pictures. |
| 6 |
|
|
* |
| 7 |
|
|
* 6/30/87 |
| 8 |
|
|
*/ |
| 9 |
|
|
|
| 10 |
|
|
#include <stdio.h> |
| 11 |
greg |
2.16 |
#include <math.h> |
| 12 |
schorsch |
2.22 |
#include <time.h> |
| 13 |
schorsch |
2.23 |
#include <string.h> |
| 14 |
greg |
2.16 |
|
| 15 |
schorsch |
2.22 |
#include "copyright.h" |
| 16 |
greg |
2.21 |
|
| 17 |
schorsch |
2.22 |
#include "platform.h" |
| 18 |
schorsch |
2.25 |
#include "rtprocess.h" |
| 19 |
greg |
1.1 |
#include "color.h" |
| 20 |
greg |
1.10 |
#include "resolu.h" |
| 21 |
greg |
1.1 |
|
| 22 |
greg |
2.15 |
#define MAXFILE 64 |
| 23 |
greg |
1.1 |
|
| 24 |
greg |
2.17 |
#define HASMIN 1 |
| 25 |
|
|
#define HASMAX 2 |
| 26 |
|
|
|
| 27 |
greg |
1.1 |
/* output picture size */ |
| 28 |
|
|
int xsiz = 0; |
| 29 |
|
|
int ysiz = 0; |
| 30 |
|
|
/* input dimensions */ |
| 31 |
|
|
int xmin = 0; |
| 32 |
|
|
int ymin = 0; |
| 33 |
|
|
int xmax = 0; |
| 34 |
|
|
int ymax = 0; |
| 35 |
|
|
|
| 36 |
|
|
COLR bgcolr = BLKCOLR; /* background color */ |
| 37 |
|
|
|
| 38 |
greg |
1.9 |
int labelht = 24; /* label height */ |
| 39 |
|
|
|
| 40 |
greg |
1.1 |
int checkthresh = 0; /* check threshold value */ |
| 41 |
|
|
|
| 42 |
greg |
2.28 |
char StandardInput[] = "<stdin>"; |
| 43 |
greg |
2.14 |
char Command[] = "<Command>"; |
| 44 |
|
|
char Label[] = "<Label>"; |
| 45 |
|
|
|
| 46 |
greg |
1.1 |
char *progname; |
| 47 |
|
|
|
| 48 |
|
|
struct { |
| 49 |
greg |
1.7 |
char *name; /* file or command name */ |
| 50 |
greg |
1.1 |
FILE *fp; /* stream pointer */ |
| 51 |
|
|
int xres, yres; /* picture size */ |
| 52 |
|
|
int xloc, yloc; /* anchor point */ |
| 53 |
greg |
2.17 |
int flags; /* HASMIN, HASMAX */ |
| 54 |
greg |
1.1 |
COLR thmin, thmax; /* thresholds */ |
| 55 |
|
|
} input[MAXFILE]; /* our input files */ |
| 56 |
|
|
|
| 57 |
|
|
int nfile; /* number of files */ |
| 58 |
|
|
|
| 59 |
greg |
2.19 |
char ourfmt[LPICFMT+1] = PICFMT; |
| 60 |
greg |
1.6 |
int wrongformat = 0; |
| 61 |
greg |
1.1 |
|
| 62 |
greg |
2.21 |
FILE *lblopen(); |
| 63 |
|
|
void quit(); |
| 64 |
greg |
1.7 |
|
| 65 |
schorsch |
2.27 |
static gethfunc tabputs; |
| 66 |
greg |
2.15 |
|
| 67 |
schorsch |
2.27 |
|
| 68 |
|
|
static int |
| 69 |
|
|
tabputs( /* print line preceded by a tab */ |
| 70 |
|
|
char *s, |
| 71 |
|
|
void *p |
| 72 |
|
|
) |
| 73 |
greg |
1.1 |
{ |
| 74 |
greg |
1.6 |
char fmt[32]; |
| 75 |
|
|
|
| 76 |
greg |
2.18 |
if (isheadid(s)) |
| 77 |
gwlarson |
2.20 |
return(0); |
| 78 |
greg |
2.19 |
if (formatval(fmt, s)) { |
| 79 |
|
|
if (globmatch(ourfmt, fmt)) { |
| 80 |
|
|
wrongformat = 0; |
| 81 |
|
|
strcpy(ourfmt, fmt); |
| 82 |
|
|
} else |
| 83 |
|
|
wrongformat = 1; |
| 84 |
|
|
} else { |
| 85 |
greg |
1.6 |
putc('\t', stdout); |
| 86 |
|
|
fputs(s, stdout); |
| 87 |
|
|
} |
| 88 |
gwlarson |
2.20 |
return(0); |
| 89 |
greg |
1.1 |
} |
| 90 |
|
|
|
| 91 |
|
|
|
| 92 |
|
|
main(argc, argv) |
| 93 |
|
|
int argc; |
| 94 |
|
|
char *argv[]; |
| 95 |
|
|
{ |
| 96 |
greg |
1.7 |
int ncolumns = 0; |
| 97 |
greg |
1.9 |
int autolabel = 0; |
| 98 |
greg |
2.11 |
int curcol = 0, x0 = 0, curx = 0, cury = 0, spacing = 0; |
| 99 |
greg |
2.17 |
int xsgn, ysgn; |
| 100 |
greg |
1.9 |
char *thislabel; |
| 101 |
greg |
1.1 |
int an; |
| 102 |
schorsch |
2.22 |
SET_DEFAULT_BINARY(); |
| 103 |
|
|
SET_FILE_BINARY(stdin); |
| 104 |
|
|
SET_FILE_BINARY(stdout); |
| 105 |
greg |
1.1 |
progname = argv[0]; |
| 106 |
|
|
|
| 107 |
|
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
| 108 |
|
|
switch (argv[an][1]) { |
| 109 |
|
|
case 'x': |
| 110 |
greg |
2.11 |
xsiz = atoi(argv[++an]); |
| 111 |
greg |
1.1 |
break; |
| 112 |
|
|
case 'y': |
| 113 |
greg |
2.11 |
ysiz = atoi(argv[++an]); |
| 114 |
greg |
1.1 |
break; |
| 115 |
|
|
case 'b': |
| 116 |
|
|
setcolr(bgcolr, atof(argv[an+1]), |
| 117 |
|
|
atof(argv[an+2]), |
| 118 |
|
|
atof(argv[an+3])); |
| 119 |
|
|
an += 3; |
| 120 |
|
|
break; |
| 121 |
greg |
1.7 |
case 'a': |
| 122 |
|
|
ncolumns = atoi(argv[++an]); |
| 123 |
|
|
break; |
| 124 |
greg |
2.11 |
case 's': |
| 125 |
|
|
spacing = atoi(argv[++an]); |
| 126 |
|
|
break; |
| 127 |
|
|
case 'o': |
| 128 |
|
|
curx = x0 = atoi(argv[++an]); |
| 129 |
|
|
cury = atoi(argv[++an]); |
| 130 |
|
|
break; |
| 131 |
greg |
1.7 |
case 'l': |
| 132 |
greg |
1.9 |
switch (argv[an][2]) { |
| 133 |
|
|
case 'a': |
| 134 |
|
|
autolabel++; |
| 135 |
|
|
break; |
| 136 |
|
|
case 'h': |
| 137 |
|
|
labelht = atoi(argv[++an]); |
| 138 |
|
|
break; |
| 139 |
|
|
case '\0': |
| 140 |
|
|
goto dofiles; |
| 141 |
|
|
default: |
| 142 |
|
|
goto userr; |
| 143 |
|
|
} |
| 144 |
greg |
1.7 |
break; |
| 145 |
greg |
1.1 |
case '\0': |
| 146 |
|
|
case 't': |
| 147 |
|
|
goto dofiles; |
| 148 |
|
|
default: |
| 149 |
|
|
goto userr; |
| 150 |
|
|
} |
| 151 |
|
|
dofiles: |
| 152 |
greg |
2.18 |
newheader("RADIANCE", stdout); |
| 153 |
greg |
2.21 |
fputnow(stdout); |
| 154 |
greg |
1.1 |
for (nfile = 0; an < argc; nfile++) { |
| 155 |
greg |
1.9 |
if (nfile >= MAXFILE) |
| 156 |
|
|
goto toomany; |
| 157 |
greg |
2.6 |
thislabel = NULL; |
| 158 |
greg |
2.17 |
input[nfile].flags = 0; |
| 159 |
|
|
xsgn = ysgn = '-'; |
| 160 |
|
|
while (an < argc && (argv[an][0] == '-' || argv[an][0] == '+' |
| 161 |
|
|
|| argv[an][0] == '=')) { |
| 162 |
greg |
1.1 |
switch (argv[an][1]) { |
| 163 |
|
|
case 't': |
| 164 |
|
|
checkthresh = 1; |
| 165 |
|
|
if (argv[an][0] == '-') { |
| 166 |
greg |
2.17 |
input[nfile].flags |= HASMIN; |
| 167 |
greg |
1.1 |
setcolr(input[nfile].thmin, |
| 168 |
|
|
atof(argv[an+1]), |
| 169 |
|
|
atof(argv[an+1]), |
| 170 |
|
|
atof(argv[an+1])); |
| 171 |
greg |
2.17 |
} else if (argv[an][0] == '+') { |
| 172 |
|
|
input[nfile].flags |= HASMAX; |
| 173 |
greg |
1.1 |
setcolr(input[nfile].thmax, |
| 174 |
|
|
atof(argv[an+1]), |
| 175 |
|
|
atof(argv[an+1]), |
| 176 |
|
|
atof(argv[an+1])); |
| 177 |
greg |
2.17 |
} else |
| 178 |
|
|
goto userr; |
| 179 |
|
|
an++; |
| 180 |
greg |
1.1 |
break; |
| 181 |
greg |
1.9 |
case 'l': |
| 182 |
|
|
if (strcmp(argv[an], "-l")) |
| 183 |
|
|
goto userr; |
| 184 |
greg |
2.17 |
thislabel = argv[++an]; |
| 185 |
greg |
1.9 |
break; |
| 186 |
greg |
2.17 |
case '+': |
| 187 |
|
|
case '-': |
| 188 |
|
|
case '0': |
| 189 |
|
|
if (argv[an][0] != '=') |
| 190 |
|
|
goto userr; |
| 191 |
|
|
xsgn = argv[an][1]; |
| 192 |
|
|
ysgn = argv[an][2]; |
| 193 |
|
|
if (ysgn != '+' && ysgn != '-' && ysgn != '0') |
| 194 |
|
|
goto userr; |
| 195 |
|
|
break; |
| 196 |
greg |
1.1 |
case '\0': |
| 197 |
|
|
if (argv[an][0] == '-') |
| 198 |
|
|
goto getfile; |
| 199 |
greg |
1.9 |
goto userr; |
| 200 |
greg |
1.1 |
default: |
| 201 |
|
|
goto userr; |
| 202 |
|
|
} |
| 203 |
greg |
2.17 |
an++; |
| 204 |
|
|
} |
| 205 |
greg |
1.1 |
getfile: |
| 206 |
greg |
1.7 |
if (argc-an < (ncolumns ? 1 : 3)) |
| 207 |
greg |
1.1 |
goto userr; |
| 208 |
greg |
2.6 |
if (autolabel && thislabel == NULL) |
| 209 |
|
|
thislabel = argv[an]; |
| 210 |
greg |
1.1 |
if (!strcmp(argv[an], "-")) { |
| 211 |
greg |
2.28 |
input[nfile].name = StandardInput; |
| 212 |
greg |
1.1 |
input[nfile].fp = stdin; |
| 213 |
|
|
} else { |
| 214 |
greg |
2.4 |
if (argv[an][0] == '!') { |
| 215 |
greg |
2.14 |
input[nfile].name = Command; |
| 216 |
greg |
2.4 |
input[nfile].fp = popen(argv[an]+1, "r"); |
| 217 |
|
|
} else { |
| 218 |
|
|
input[nfile].name = argv[an]; |
| 219 |
|
|
input[nfile].fp = fopen(argv[an], "r"); |
| 220 |
|
|
} |
| 221 |
|
|
if (input[nfile].fp == NULL) { |
| 222 |
greg |
1.5 |
perror(argv[an]); |
| 223 |
greg |
1.1 |
quit(1); |
| 224 |
|
|
} |
| 225 |
|
|
} |
| 226 |
|
|
an++; |
| 227 |
|
|
/* get header */ |
| 228 |
|
|
printf("%s:\n", input[nfile].name); |
| 229 |
greg |
1.6 |
getheader(input[nfile].fp, tabputs, NULL); |
| 230 |
|
|
if (wrongformat) { |
| 231 |
greg |
2.21 |
fprintf(stderr, "%s: incompatible input format\n", |
| 232 |
greg |
1.6 |
input[nfile].name); |
| 233 |
|
|
quit(1); |
| 234 |
|
|
} |
| 235 |
greg |
1.1 |
/* get picture size */ |
| 236 |
greg |
1.4 |
if (fgetresolu(&input[nfile].xres, &input[nfile].yres, |
| 237 |
greg |
1.10 |
input[nfile].fp) < 0) { |
| 238 |
greg |
1.1 |
fprintf(stderr, "%s: bad picture size\n", |
| 239 |
|
|
input[nfile].name); |
| 240 |
|
|
quit(1); |
| 241 |
|
|
} |
| 242 |
greg |
1.7 |
if (ncolumns > 0) { |
| 243 |
|
|
if (curcol >= ncolumns) { |
| 244 |
greg |
2.11 |
cury = ymax + spacing; |
| 245 |
|
|
curx = x0; |
| 246 |
greg |
1.7 |
curcol = 0; |
| 247 |
|
|
} |
| 248 |
|
|
input[nfile].xloc = curx; |
| 249 |
|
|
input[nfile].yloc = cury; |
| 250 |
greg |
2.11 |
curx += input[nfile].xres + spacing; |
| 251 |
greg |
1.7 |
curcol++; |
| 252 |
|
|
} else { |
| 253 |
|
|
input[nfile].xloc = atoi(argv[an++]); |
| 254 |
greg |
2.17 |
if (xsgn == '+') |
| 255 |
|
|
input[nfile].xloc -= input[nfile].xres; |
| 256 |
|
|
else if (xsgn == '0') |
| 257 |
|
|
input[nfile].xloc -= input[nfile].xres/2; |
| 258 |
greg |
1.7 |
input[nfile].yloc = atoi(argv[an++]); |
| 259 |
greg |
2.17 |
if (ysgn == '+') |
| 260 |
|
|
input[nfile].yloc -= input[nfile].yres; |
| 261 |
|
|
else if (ysgn == '0') |
| 262 |
|
|
input[nfile].yloc -= input[nfile].yres/2; |
| 263 |
greg |
1.7 |
} |
| 264 |
greg |
1.1 |
if (input[nfile].xloc < xmin) |
| 265 |
|
|
xmin = input[nfile].xloc; |
| 266 |
|
|
if (input[nfile].yloc < ymin) |
| 267 |
|
|
ymin = input[nfile].yloc; |
| 268 |
|
|
if (input[nfile].xloc+input[nfile].xres > xmax) |
| 269 |
|
|
xmax = input[nfile].xloc+input[nfile].xres; |
| 270 |
|
|
if (input[nfile].yloc+input[nfile].yres > ymax) |
| 271 |
|
|
ymax = input[nfile].yloc+input[nfile].yres; |
| 272 |
greg |
1.9 |
if (thislabel != NULL) { |
| 273 |
|
|
if (++nfile >= MAXFILE) |
| 274 |
|
|
goto toomany; |
| 275 |
greg |
2.14 |
input[nfile].name = Label; |
| 276 |
greg |
2.17 |
input[nfile].flags = 0; |
| 277 |
greg |
2.7 |
input[nfile].xres = input[nfile-1].xres; |
| 278 |
|
|
input[nfile].yres = labelht; |
| 279 |
greg |
1.9 |
if ((input[nfile].fp = lblopen(thislabel, |
| 280 |
|
|
&input[nfile].xres, |
| 281 |
|
|
&input[nfile].yres)) == NULL) |
| 282 |
greg |
1.7 |
goto labelerr; |
| 283 |
|
|
input[nfile].xloc = input[nfile-1].xloc; |
| 284 |
|
|
input[nfile].yloc = input[nfile-1].yloc + |
| 285 |
greg |
1.9 |
input[nfile-1].yres-input[nfile].yres; |
| 286 |
greg |
1.7 |
} |
| 287 |
greg |
1.1 |
} |
| 288 |
|
|
if (xsiz <= 0) |
| 289 |
|
|
xsiz = xmax; |
| 290 |
greg |
2.11 |
else if (xsiz > xmax) |
| 291 |
|
|
xmax = xsiz; |
| 292 |
greg |
1.1 |
if (ysiz <= 0) |
| 293 |
|
|
ysiz = ymax; |
| 294 |
greg |
2.11 |
else if (ysiz > ymax) |
| 295 |
|
|
ymax = ysiz; |
| 296 |
greg |
1.1 |
/* add new header info. */ |
| 297 |
|
|
printargs(argc, argv, stdout); |
| 298 |
greg |
2.19 |
if (strcmp(ourfmt, PICFMT)) |
| 299 |
|
|
fputformat(ourfmt, stdout); /* print format if known */ |
| 300 |
greg |
1.10 |
putchar('\n'); |
| 301 |
|
|
fprtresolu(xsiz, ysiz, stdout); |
| 302 |
greg |
1.1 |
|
| 303 |
|
|
compos(); |
| 304 |
|
|
|
| 305 |
|
|
quit(0); |
| 306 |
|
|
userr: |
| 307 |
greg |
2.11 |
fprintf(stderr, |
| 308 |
|
|
"Usage: %s [-x xr][-y yr][-b r g b][-a n][-s p][-o x0 y0][-la][-lh h] ", |
| 309 |
greg |
1.8 |
progname); |
| 310 |
greg |
2.17 |
fprintf(stderr, "[-t min1][+t max1][-l lab][=SS] pic1 x1 y1 ..\n"); |
| 311 |
greg |
1.7 |
quit(1); |
| 312 |
greg |
1.9 |
toomany: |
| 313 |
|
|
fprintf(stderr, "%s: only %d files and labels allowed\n", |
| 314 |
|
|
progname, MAXFILE); |
| 315 |
|
|
quit(1); |
| 316 |
greg |
1.7 |
labelerr: |
| 317 |
|
|
fprintf(stderr, "%s: error opening label\n", progname); |
| 318 |
greg |
1.1 |
quit(1); |
| 319 |
|
|
} |
| 320 |
|
|
|
| 321 |
|
|
|
| 322 |
|
|
compos() /* composite pictures */ |
| 323 |
|
|
{ |
| 324 |
|
|
COLR *scanin, *scanout; |
| 325 |
|
|
int y; |
| 326 |
|
|
register int x, i; |
| 327 |
|
|
|
| 328 |
greg |
1.3 |
scanin = (COLR *)malloc((xmax-xmin)*sizeof(COLR)); |
| 329 |
greg |
1.1 |
if (scanin == NULL) |
| 330 |
|
|
goto memerr; |
| 331 |
|
|
scanin -= xmin; |
| 332 |
|
|
if (checkthresh) { |
| 333 |
|
|
scanout = (COLR *)malloc(xsiz*sizeof(COLR)); |
| 334 |
|
|
if (scanout == NULL) |
| 335 |
|
|
goto memerr; |
| 336 |
|
|
} else |
| 337 |
|
|
scanout = scanin; |
| 338 |
|
|
for (y = ymax-1; y >= 0; y--) { |
| 339 |
|
|
for (x = 0; x < xsiz; x++) |
| 340 |
|
|
copycolr(scanout[x], bgcolr); |
| 341 |
|
|
for (i = 0; i < nfile; i++) { |
| 342 |
|
|
if (input[i].yloc > y || |
| 343 |
|
|
input[i].yloc+input[i].yres <= y) |
| 344 |
|
|
continue; |
| 345 |
|
|
if (freadcolrs(scanin+input[i].xloc, |
| 346 |
|
|
input[i].xres, input[i].fp) < 0) { |
| 347 |
greg |
1.2 |
fprintf(stderr, "%s: read error (y==%d)\n", |
| 348 |
|
|
input[i].name, |
| 349 |
|
|
y-input[i].yloc); |
| 350 |
greg |
1.1 |
quit(1); |
| 351 |
|
|
} |
| 352 |
|
|
if (y >= ysiz) |
| 353 |
|
|
continue; |
| 354 |
|
|
if (checkthresh) { |
| 355 |
|
|
x = input[i].xloc+input[i].xres; |
| 356 |
|
|
if (x > xsiz) |
| 357 |
|
|
x = xsiz; |
| 358 |
|
|
for (x--; x >= 0 && x >= input[i].xloc; x--) { |
| 359 |
greg |
2.17 |
if (input[i].flags & HASMIN && |
| 360 |
greg |
1.1 |
cmpcolr(scanin[x], input[i].thmin) <= 0) |
| 361 |
|
|
continue; |
| 362 |
greg |
2.17 |
if (input[i].flags & HASMAX && |
| 363 |
greg |
1.1 |
cmpcolr(scanin[x], input[i].thmax) >= 0) |
| 364 |
|
|
continue; |
| 365 |
|
|
copycolr(scanout[x], scanin[x]); |
| 366 |
|
|
} |
| 367 |
|
|
} |
| 368 |
|
|
} |
| 369 |
|
|
if (y >= ysiz) |
| 370 |
|
|
continue; |
| 371 |
|
|
if (fwritecolrs(scanout, xsiz, stdout) < 0) { |
| 372 |
greg |
1.5 |
perror(progname); |
| 373 |
greg |
1.1 |
quit(1); |
| 374 |
|
|
} |
| 375 |
|
|
} |
| 376 |
greg |
2.28 |
/* read remainders from streams */ |
| 377 |
|
|
for (i = 0; i < nfile; i++) |
| 378 |
|
|
if (input[i].name[0] == '<') |
| 379 |
|
|
while (getc(input[i].fp) != EOF) |
| 380 |
|
|
; |
| 381 |
greg |
1.1 |
return; |
| 382 |
|
|
memerr: |
| 383 |
greg |
1.5 |
perror(progname); |
| 384 |
greg |
1.1 |
quit(1); |
| 385 |
|
|
} |
| 386 |
|
|
|
| 387 |
|
|
|
| 388 |
|
|
int |
| 389 |
|
|
cmpcolr(c1, c2) /* compare two colr's (improvisation) */ |
| 390 |
|
|
register COLR c1, c2; |
| 391 |
|
|
{ |
| 392 |
|
|
register int i, j; |
| 393 |
|
|
|
| 394 |
|
|
j = 4; /* check exponents first! */ |
| 395 |
|
|
while (j--) |
| 396 |
schorsch |
2.24 |
if ( (i = c1[j] - c2[j]) ) |
| 397 |
greg |
1.1 |
return(i); |
| 398 |
|
|
return(0); |
| 399 |
greg |
1.9 |
} |
| 400 |
|
|
|
| 401 |
|
|
|
| 402 |
|
|
FILE * |
| 403 |
|
|
lblopen(s, xp, yp) /* open pipe to label generator */ |
| 404 |
|
|
char *s; |
| 405 |
|
|
int *xp, *yp; |
| 406 |
|
|
{ |
| 407 |
schorsch |
2.26 |
char com[PATH_MAX]; |
| 408 |
greg |
1.9 |
FILE *fp; |
| 409 |
|
|
|
| 410 |
greg |
2.7 |
sprintf(com, "psign -s -.15 -a 2 -x %d -y %d '%.90s'", *xp, *yp, s); |
| 411 |
greg |
1.9 |
if ((fp = popen(com, "r")) == NULL) |
| 412 |
|
|
return(NULL); |
| 413 |
|
|
if (checkheader(fp, COLRFMT, NULL) < 0) |
| 414 |
|
|
goto err; |
| 415 |
greg |
1.10 |
if (fgetresolu(xp, yp, fp) < 0) |
| 416 |
greg |
1.9 |
goto err; |
| 417 |
|
|
return(fp); |
| 418 |
|
|
err: |
| 419 |
|
|
pclose(fp); |
| 420 |
|
|
return(NULL); |
| 421 |
greg |
1.1 |
} |
| 422 |
|
|
|
| 423 |
|
|
|
| 424 |
greg |
2.21 |
void |
| 425 |
greg |
1.1 |
quit(code) /* exit gracefully */ |
| 426 |
|
|
int code; |
| 427 |
|
|
{ |
| 428 |
greg |
2.13 |
register int i; |
| 429 |
|
|
/* close input files */ |
| 430 |
|
|
for (i = 0; i < nfile; i++) |
| 431 |
greg |
2.14 |
if (input[i].name == Command || input[i].name == Label) |
| 432 |
|
|
pclose(input[i].fp); |
| 433 |
|
|
else |
| 434 |
|
|
fclose(input[i].fp); |
| 435 |
greg |
1.1 |
exit(code); |
| 436 |
|
|
} |