1 /*write sequential formatted external*/
5 extern int x_putc(),w_ed(),w_ned();
6 extern int xw_end(),xw_rev(),x_wSL();
8 integer s_wsfe(a) cilist *a; /*start*/
11 if(n=c_sfe(a)) return(n);
17 hiwater = cursor=recpos=0;
21 curunit = &units[a->ciunit];
23 if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio");
32 cblank=curunit->ublnk;
33 if(curunit->uwrt != 1 && nowwriting(curunit))
34 err(a->cierr,errno,"write start");
39 /* this uses \n as an indicator of record-end */
40 if(c == '\n' && recpos < hiwater) { /* fseek calls fflush, a loss */
41 #ifndef NON_UNIX_STDIO
42 if(cf->_ptr + hiwater - recpos < buf_end(cf))
43 cf->_ptr += hiwater - recpos;
46 (void) fseek(cf, (long)(hiwater - recpos), SEEK_CUR);
52 { static flag new = 1;
60 if(c=='0') putc('\n',cf);
61 else if(c=='1') putc('\f',cf);
77 hiwater = recpos = cursor = 0;
82 if(workdone) (*putn)('\n');
83 hiwater = recpos = cursor = 0;