Doxygen Source Code Documentation
wsfe.c File Reference
#include "f2c.h"#include "fio.h"#include "fmt.h"Go to the source code of this file.
Functions | |
| x_putc (int c) | |
| x_wSL (Void) | |
| xw_end (Void) | |
| xw_rev (Void) | |
| integer | s_wsfe (cilist *a) |
Variables | |
| int | f__hiwater |
Function Documentation
|
|
Definition at line 55 of file wsfe.c. References a, c_sfe(), err, f__hiwater, f__nowwriting(), f_init(), fmt_bg(), pars_f(), x_putc(), x_wSL(), xw_end(), and xw_rev(). Referenced by ff_(), MAIN__(), parser_(), qqqerr_(), and set_().
00057 { int n;
00058 if(!f__init) f_init();
00059 if(n=c_sfe(a)) return(n);
00060 f__reading=0;
00061 f__sequential=1;
00062 f__formatted=1;
00063 f__external=1;
00064 f__elist=a;
00065 f__hiwater = f__cursor=f__recpos=0;
00066 f__nonl = 0;
00067 f__scale=0;
00068 f__fmtbuf=a->cifmt;
00069 f__curunit = &f__units[a->ciunit];
00070 f__cf=f__curunit->ufd;
00071 if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
00072 f__putn= x_putc;
00073 f__doed= w_ed;
00074 f__doned= w_ned;
00075 f__doend=xw_end;
00076 f__dorevert=xw_rev;
00077 f__donewrec=x_wSL;
00078 fmt_bg();
00079 f__cplus=0;
00080 f__cblank=f__curunit->ublnk;
00081 if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
00082 err(a->cierr,errno,"write start");
00083 return(0);
00084 }
|
|
|
Definition at line 10 of file wsfe.c. References buf_end, c, and f__hiwater. Referenced by s_wsfe().
00012 {
00013 /* this uses \n as an indicator of record-end */
00014 if(c == '\n' && f__recpos < f__hiwater) { /* fseek calls fflush, a loss */
00015 #ifndef NON_UNIX_STDIO
00016 if(f__cf->_ptr + f__hiwater - f__recpos < buf_end(f__cf))
00017 f__cf->_ptr += f__hiwater - f__recpos;
00018 else
00019 #endif
00020 (void) fseek(f__cf, (long)(f__hiwater - f__recpos), SEEK_CUR);
00021 }
00022 #ifdef OMIT_BLANK_CC
00023 if (!f__recpos++ && c == ' ')
00024 return c;
00025 #else
00026 f__recpos++;
00027 #endif
00028 return putc(c,f__cf);
00029 }
|
|
|
Definition at line 30 of file wsfe.c. References f__hiwater. Referenced by s_wsfe().
00031 {
00032 (*f__putn)('\n');
00033 f__recpos=0;
00034 f__cursor = 0;
00035 f__hiwater = 0;
00036 return(1);
00037 }
|
|
|
Definition at line 38 of file wsfe.c. References f__hiwater. Referenced by s_wsfe().
00039 {
00040 if(f__nonl == 0)
00041 (*f__putn)('\n');
00042 f__hiwater = f__recpos = f__cursor = 0;
00043 return(0);
00044 }
|
|
|
Definition at line 45 of file wsfe.c. References f__hiwater. Referenced by s_wsfe().
00046 {
00047 if(f__workdone) (*f__putn)('\n');
00048 f__hiwater = f__recpos = f__cursor = 0;
00049 return(f__workdone=0);
00050 }
|
Variable Documentation
|
|
Definition at line 5 of file wsfe.c. Referenced by s_wsfe(), x_putc(), x_wSL(), xw_end(), and xw_rev(). |