8 |
|
|
9 |
|
#include "rcontrib.h" |
10 |
|
#include "resolu.h" |
11 |
< |
#include "platform.h" |
11 |
> |
#include <ctype.h> |
12 |
|
|
13 |
|
/* Close output stream and free record */ |
14 |
|
static void |
183 |
|
} |
184 |
|
} |
185 |
|
if (!noopen && sop->ofp == NULL) { /* open output stream */ |
186 |
– |
long i; |
186 |
|
if (oname[0] == '!') /* output to command */ |
187 |
|
sop->ofp = popen(oname+1, "w"); |
188 |
|
else /* else open file */ |
212 |
|
sop->xr = xres; sop->yr = yres; |
213 |
|
} |
214 |
|
printresolu(sop->ofp, sop->xr, sop->yr); |
216 |
– |
#if 0 |
217 |
– |
/* play catch-up */ |
218 |
– |
for (i = accumulate > 0 ? lastdone/accumulate : 0; i--; ) { |
219 |
– |
int j = sop->reclen; |
220 |
– |
if (j <= 0) j = 1; |
221 |
– |
while (j--) |
222 |
– |
put_contrib(nocontrib, sop->ofp); |
223 |
– |
if (outfmt == 'a') |
224 |
– |
putc('\n', sop->ofp); |
225 |
– |
} |
226 |
– |
#endif |
215 |
|
if (waitflush > 0) |
216 |
|
fflush(sop->ofp); |
217 |
|
} |
352 |
|
end_record() |
353 |
|
{ |
354 |
|
--waitflush; |
355 |
< |
lu_doall(&ofiletab, puteol, NULL); |
355 |
> |
lu_doall(&ofiletab, &puteol, NULL); |
356 |
|
if (using_stdout & (outfmt == 'a')) |
357 |
|
putc('\n', stdout); |
358 |
|
if (!waitflush) { |
502 |
|
*(STREAMOUT *)oent->data = sout; |
503 |
|
} |
504 |
|
} |
505 |
< |
lu_doall(&ofiletab, myclose, NULL); /* close all files */ |
505 |
> |
lu_doall(&ofiletab, &myclose, NULL); /* close all files */ |
506 |
|
} |
507 |
|
|
508 |
|
|
658 |
|
} |
659 |
|
/* seek on all files */ |
660 |
|
nvals = lastout * outvsiz; |
661 |
< |
lu_doall(&ofiletab, myseeko, &nvals); |
661 |
> |
lu_doall(&ofiletab, &myseeko, &nvals); |
662 |
|
/* skip repeated input */ |
663 |
+ |
lastout *= accumulate; |
664 |
|
for (nvals = 0; nvals < lastout; nvals++) { |
665 |
|
FVECT vdummy; |
666 |
|
if (getvec(vdummy) < 0 || getvec(vdummy) < 0) |
667 |
|
error(USER, "unexpected EOF on input"); |
668 |
|
} |
669 |
< |
lastray = lastdone = (RNUMBER)lastout * accumulate; |
669 |
> |
lastray = lastdone = (RNUMBER)lastout; |
670 |
|
if (raysleft) |
671 |
|
raysleft -= lastray; |
672 |
|
} |