139 |
|
char oname[1024]; |
140 |
|
LUENT *lep; |
141 |
|
STREAMOUT *sop; |
142 |
+ |
char *cp; |
143 |
|
|
144 |
|
if (ospec == NULL) { /* use stdout? */ |
145 |
|
if (!noopen & !using_stdout) { |
146 |
|
if (outfmt != 'a') |
147 |
|
SET_FILE_BINARY(stdout); |
148 |
|
if (header) { |
149 |
< |
sprintf(info, "NCOLS=%d\nNCOMP=3\n", |
150 |
< |
stdos.reclen); |
149 |
> |
cp = info; |
150 |
> |
if (yres > 0) { |
151 |
> |
sprintf(cp, "NROWS=%d\n", yres * |
152 |
> |
(xres + !xres) ); |
153 |
> |
while (*cp) ++cp; |
154 |
> |
} |
155 |
> |
if ((xres <= 0) | (stdos.reclen > 1)) |
156 |
> |
sprintf(cp, "NCOLS=%d\n", stdos.reclen); |
157 |
|
printheader(stdout, info); |
158 |
|
} |
159 |
< |
printresolu(stdout, xres, yres); |
159 |
> |
if (stdos.reclen == 1) |
160 |
> |
printresolu(stdout, xres, yres); |
161 |
|
if (waitflush > 0) |
162 |
|
fflush(stdout); |
163 |
|
stdos.xr = xres; stdos.yr = yres; |
206 |
|
#ifdef getc_unlocked |
207 |
|
flockfile(sop->ofp); /* avoid lock/unlock overhead */ |
208 |
|
#endif |
209 |
+ |
if (accumulate > 0) { /* global resolution */ |
210 |
+ |
sop->xr = xres; sop->yr = yres; |
211 |
+ |
} |
212 |
|
if (header) { |
213 |
< |
char *cp = info; |
213 |
> |
cp = info; |
214 |
|
if (ofl & OF_MODIFIER || sop->reclen == 1) { |
215 |
|
sprintf(cp, "MODIFIER=%s\n", mname); |
216 |
|
while (*cp) ++cp; |
219 |
|
sprintf(cp, "BIN=%d\n", bn); |
220 |
|
while (*cp) ++cp; |
221 |
|
} |
222 |
< |
sprintf(cp, "NCOLS=%d\nNCOMP=3\n", sop->reclen); |
222 |
> |
if (sop->yr > 0) { |
223 |
> |
sprintf(cp, "NROWS=%d\n", sop->yr * |
224 |
> |
(sop->xr + !sop->xr) ); |
225 |
> |
while (*cp) ++cp; |
226 |
> |
} |
227 |
> |
if ((sop->xr <= 0) | (sop->reclen > 1)) |
228 |
> |
sprintf(cp, "NCOLS=%d\n", sop->reclen); |
229 |
|
printheader(sop->ofp, info); |
230 |
|
} |
231 |
< |
if (accumulate > 0) { /* global resolution */ |
232 |
< |
sop->xr = xres; sop->yr = yres; |
216 |
< |
} |
217 |
< |
printresolu(sop->ofp, sop->xr, sop->yr); |
231 |
> |
if (sop->reclen == 1) |
232 |
> |
printresolu(sop->ofp, sop->xr, sop->yr); |
233 |
|
if (waitflush > 0) |
234 |
|
fflush(sop->ofp); |
235 |
|
} |