184 |
|
sop = (STREAMOUT *)malloc(sizeof(STREAMOUT)); |
185 |
|
if (sop == NULL) |
186 |
|
error(SYSTEM, "out of memory in getostream"); |
187 |
< |
sop->outpipe = oname[0] == '!'; |
187 |
> |
sop->outpipe = (oname[0] == '!'); |
188 |
|
sop->reclen = 0; |
189 |
|
sop->ofp = NULL; /* open iff noopen==0 */ |
190 |
|
sop->xr = xres; sop->yr = yres; |
194 |
|
errno = EEXIST; /* file exists */ |
195 |
|
goto openerr; |
196 |
|
} |
197 |
+ |
} else if (noopen && outfmt == 'c' && /* stream exists to picture? */ |
198 |
+ |
(sop->xr > 0) & (sop->yr > 0)) { |
199 |
+ |
if (ofl & OF_BIN) |
200 |
+ |
return(NULL); /* let caller offset bins */ |
201 |
+ |
sprintf(errmsg, "output '%s' not a valid picture", oname); |
202 |
+ |
error(WARNING, errmsg); |
203 |
|
} |
204 |
|
if (!noopen && sop->ofp == NULL) { /* open output stream */ |
205 |
|
if (oname[0] == '!') /* output to command */ |
337 |
|
void |
338 |
|
mod_output(MODCONT *mp) |
339 |
|
{ |
340 |
< |
STREAMOUT *sop = getostream(mp->outspec, mp->modname, 0, 0); |
340 |
> |
STREAMOUT *sop = getostream(mp->outspec, mp->modname, mp->bin0, 0); |
341 |
|
int j; |
342 |
|
|
343 |
|
put_contrib(mp->cbin[0], sop->ofp); |
344 |
|
if (mp->nbins > 3 && /* minor optimization */ |
345 |
< |
sop == getostream(mp->outspec, mp->modname, 1, 0)) { |
345 |
> |
sop == getostream(mp->outspec, mp->modname, mp->bin0+1, 0)) { |
346 |
|
for (j = 1; j < mp->nbins; j++) |
347 |
|
put_contrib(mp->cbin[j], sop->ofp); |
348 |
|
} else { |
349 |
|
for (j = 1; j < mp->nbins; j++) { |
350 |
< |
sop = getostream(mp->outspec, mp->modname, j, 0); |
350 |
> |
sop = getostream(mp->outspec, mp->modname, mp->bin0+j, 0); |
351 |
|
put_contrib(mp->cbin[j], sop->ofp); |
352 |
|
} |
353 |
|
} |