|
Last change
on this file since 3687 was 1392, checked in by bird, 22 years ago |
|
This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.
|
-
Property cvs2svn:cvs-rev
set to
1.1.1.2
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
1.4 KB
|
| Line | |
|---|
| 1 | /*write sequential formatted external*/
|
|---|
| 2 | #include "config.h"
|
|---|
| 3 | #include "f2c.h"
|
|---|
| 4 | #include "fio.h"
|
|---|
| 5 | #include "fmt.h"
|
|---|
| 6 | extern int f__hiwater;
|
|---|
| 7 |
|
|---|
| 8 | int
|
|---|
| 9 | x_wSL (void)
|
|---|
| 10 | {
|
|---|
| 11 | int n = f__putbuf ('\n');
|
|---|
| 12 | f__hiwater = f__recpos = f__cursor = 0;
|
|---|
| 13 | return (n == 0);
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | static int
|
|---|
| 17 | xw_end (void)
|
|---|
| 18 | {
|
|---|
| 19 | int n;
|
|---|
| 20 |
|
|---|
| 21 | if (f__nonl)
|
|---|
| 22 | {
|
|---|
| 23 | f__putbuf (n = 0);
|
|---|
| 24 | fflush (f__cf);
|
|---|
| 25 | }
|
|---|
| 26 | else
|
|---|
| 27 | n = f__putbuf ('\n');
|
|---|
| 28 | f__hiwater = f__recpos = f__cursor = 0;
|
|---|
| 29 | return n;
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | static int
|
|---|
| 33 | xw_rev (void)
|
|---|
| 34 | {
|
|---|
| 35 | int n = 0;
|
|---|
| 36 | if (f__workdone)
|
|---|
| 37 | {
|
|---|
| 38 | n = f__putbuf ('\n');
|
|---|
| 39 | f__workdone = 0;
|
|---|
| 40 | }
|
|---|
| 41 | f__hiwater = f__recpos = f__cursor = 0;
|
|---|
| 42 | return n;
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | integer
|
|---|
| 46 | s_wsfe (cilist * a) /*start */
|
|---|
| 47 | {
|
|---|
| 48 | int n;
|
|---|
| 49 | if (f__init != 1)
|
|---|
| 50 | f_init ();
|
|---|
| 51 | f__init = 3;
|
|---|
| 52 | f__reading = 0;
|
|---|
| 53 | f__sequential = 1;
|
|---|
| 54 | f__formatted = 1;
|
|---|
| 55 | f__external = 1;
|
|---|
| 56 | if ((n = c_sfe (a)))
|
|---|
| 57 | return (n);
|
|---|
| 58 | f__elist = a;
|
|---|
| 59 | f__hiwater = f__cursor = f__recpos = 0;
|
|---|
| 60 | f__nonl = 0;
|
|---|
| 61 | f__scale = 0;
|
|---|
| 62 | f__fmtbuf = a->cifmt;
|
|---|
| 63 | f__curunit = &f__units[a->ciunit];
|
|---|
| 64 | f__cf = f__curunit->ufd;
|
|---|
| 65 | if (pars_f (f__fmtbuf) < 0)
|
|---|
| 66 | err (a->cierr, 100, "startio");
|
|---|
| 67 | f__putn = x_putc;
|
|---|
| 68 | f__doed = w_ed;
|
|---|
| 69 | f__doned = w_ned;
|
|---|
| 70 | f__doend = xw_end;
|
|---|
| 71 | f__dorevert = xw_rev;
|
|---|
| 72 | f__donewrec = x_wSL;
|
|---|
| 73 | fmt_bg ();
|
|---|
| 74 | f__cplus = 0;
|
|---|
| 75 | f__cblank = f__curunit->ublnk;
|
|---|
| 76 | if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
|
|---|
| 77 | err (a->cierr, errno, "write start");
|
|---|
| 78 | return (0);
|
|---|
| 79 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.