wsfe.c
Go to the documentation of this file.
00001 /*write sequential formatted external*/
00002 #include "f2c.h"
00003 #include "fio.h"
00004 #include "fmt.h"
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008 
00009  int
00010 x_wSL(Void)
00011 {
00012         int n = f__putbuf('\n');
00013         f__hiwater = f__recpos = f__cursor = 0;
00014         return(n == 0);
00015 }
00016 
00017  static int
00018 xw_end(Void)
00019 {
00020         int n;
00021 
00022         if(f__nonl) {
00023                 f__putbuf(n = 0);
00024                 fflush(f__cf);
00025                 }
00026         else
00027                 n = f__putbuf('\n');
00028         f__hiwater = f__recpos = f__cursor = 0;
00029         return n;
00030 }
00031 
00032  static int
00033 xw_rev(Void)
00034 {
00035         int n = 0;
00036         if(f__workdone) {
00037                 n = f__putbuf('\n');
00038                 f__workdone = 0;
00039                 }
00040         f__hiwater = f__recpos = f__cursor = 0;
00041         return n;
00042 }
00043 
00044 #ifdef KR_headers
00045 integer s_wsfe(a) cilist *a;    /*start*/
00046 #else
00047 integer s_wsfe(cilist *a)       /*start*/
00048 #endif
00049 {       int n;
00050         if(!f__init) f_init();
00051         f__reading=0;
00052         f__sequential=1;
00053         f__formatted=1;
00054         f__external=1;
00055         if(n=c_sfe(a)) return(n);
00056         f__elist=a;
00057         f__hiwater = f__cursor=f__recpos=0;
00058         f__nonl = 0;
00059         f__scale=0;
00060         f__fmtbuf=a->cifmt;
00061         f__cf=f__curunit->ufd;
00062         if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
00063         f__putn= x_putc;
00064         f__doed= w_ed;
00065         f__doned= w_ned;
00066         f__doend=xw_end;
00067         f__dorevert=xw_rev;
00068         f__donewrec=x_wSL;
00069         fmt_bg();
00070         f__cplus=0;
00071         f__cblank=f__curunit->ublnk;
00072         if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
00073                 err(a->cierr,errno,"write start");
00074         return(0);
00075 }
00076 #ifdef __cplusplus
00077 }
00078 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:16