mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 17:39:35 +08:00
e403d80d35
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value. * libI77/due.c (s_rdue, s_wdue): Likewise. * libI77/endfile.c (f_end): Likewise. * libI77/iio.c (s_rsfi, s_wsfi): Likewise. * libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise. * libI77/lwrite.c (l_g, l_put): Likewise. * libI77/open.c (f_open): Likewise. * libI77/rdfmt.c (rd_Z): Likewise. * libI77/rsfe.c (s_rsfe): Likewise. * libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen, x_rsne, s_rsne): Likewise. * libI77/sue.c (s_rsue, s_wsue): Likewise. * libI77/wref.c (wrt_E, wrt_F): Likewise. * libI77/wsfe.c (s_wsfe): Likewise. * libI77/wsle.c (s_wsle): Likewise. * libI77/wsne.c (s_wsne): Likewise. From-SVN: r54172
80 lines
1.4 KiB
C
80 lines
1.4 KiB
C
/*write sequential formatted external*/
|
|
#include "config.h"
|
|
#include "f2c.h"
|
|
#include "fio.h"
|
|
#include "fmt.h"
|
|
extern int f__hiwater;
|
|
|
|
int
|
|
x_wSL (void)
|
|
{
|
|
int n = f__putbuf ('\n');
|
|
f__hiwater = f__recpos = f__cursor = 0;
|
|
return (n == 0);
|
|
}
|
|
|
|
static int
|
|
xw_end (void)
|
|
{
|
|
int n;
|
|
|
|
if (f__nonl)
|
|
{
|
|
f__putbuf (n = 0);
|
|
fflush (f__cf);
|
|
}
|
|
else
|
|
n = f__putbuf ('\n');
|
|
f__hiwater = f__recpos = f__cursor = 0;
|
|
return n;
|
|
}
|
|
|
|
static int
|
|
xw_rev (void)
|
|
{
|
|
int n = 0;
|
|
if (f__workdone)
|
|
{
|
|
n = f__putbuf ('\n');
|
|
f__workdone = 0;
|
|
}
|
|
f__hiwater = f__recpos = f__cursor = 0;
|
|
return n;
|
|
}
|
|
|
|
integer
|
|
s_wsfe (cilist * a) /*start */
|
|
{
|
|
int n;
|
|
if (f__init != 1)
|
|
f_init ();
|
|
f__init = 3;
|
|
f__reading = 0;
|
|
f__sequential = 1;
|
|
f__formatted = 1;
|
|
f__external = 1;
|
|
if ((n = c_sfe (a)))
|
|
return (n);
|
|
f__elist = a;
|
|
f__hiwater = f__cursor = f__recpos = 0;
|
|
f__nonl = 0;
|
|
f__scale = 0;
|
|
f__fmtbuf = a->cifmt;
|
|
f__curunit = &f__units[a->ciunit];
|
|
f__cf = f__curunit->ufd;
|
|
if (pars_f (f__fmtbuf) < 0)
|
|
err (a->cierr, 100, "startio");
|
|
f__putn = x_putc;
|
|
f__doed = w_ed;
|
|
f__doned = w_ned;
|
|
f__doend = xw_end;
|
|
f__dorevert = xw_rev;
|
|
f__donewrec = x_wSL;
|
|
fmt_bg ();
|
|
f__cplus = 0;
|
|
f__cblank = f__curunit->ublnk;
|
|
if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
|
|
err (a->cierr, errno, "write start");
|
|
return (0);
|
|
}
|