diff options
author | Craig Burley <burley@gnu.org> | 1998-05-19 06:52:03 -0400 |
---|---|---|
committer | Dave Love <fx@gcc.gnu.org> | 1998-05-19 10:52:03 +0000 |
commit | a843efa0d4ff93324077fbd8b1fc57ed8f4b57f0 (patch) | |
tree | c4e8e02849cc5a16fa5bc00db65b9b2aa8561eaf /libf2c/libI77/wsfe.c | |
parent | deec641e31ba6af1cf67f72546486d5b8c37ee69 (diff) | |
download | gcc-a843efa0d4ff93324077fbd8b1fc57ed8f4b57f0.zip gcc-a843efa0d4ff93324077fbd8b1fc57ed8f4b57f0.tar.gz gcc-a843efa0d4ff93324077fbd8b1fc57ed8f4b57f0.tar.bz2 |
Update to Netlib version of 1998-04-20
From-SVN: r19877
Diffstat (limited to 'libf2c/libI77/wsfe.c')
-rw-r--r-- | libf2c/libI77/wsfe.c | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/libf2c/libI77/wsfe.c b/libf2c/libI77/wsfe.c index 5adb1a4..6cb4e50 100644 --- a/libf2c/libI77/wsfe.c +++ b/libf2c/libI77/wsfe.c @@ -4,49 +4,38 @@ #include "fmt.h" extern int f__hiwater; -#ifdef KR_headers -x_putc(c) -#else -x_putc(int c) -#endif -{ - /* this uses \n as an indicator of record-end */ - if(c == '\n' && f__recpos < f__hiwater) { /* fseek calls fflush, a loss */ -#if ! defined (NON_UNIX_STDIO) && ! defined (MISSING_FILE_ELEMS) - if(f__cf->_ptr + f__hiwater - f__recpos < buf_end(f__cf)) - f__cf->_ptr += f__hiwater - f__recpos; - else -#endif - (void) fseek(f__cf, (long)(f__hiwater - f__recpos), SEEK_CUR); - } -#ifdef OMIT_BLANK_CC - if (!f__recpos++ && c == ' ') - return c; -#else - f__recpos++; -#endif - return putc(c,f__cf); -} x_wSL(Void) { - (*f__putn)('\n'); - f__recpos=0; - f__cursor = 0; - f__hiwater = 0; - return(1); + int n = f__putbuf('\n'); + f__hiwater = f__recpos = f__cursor = 0; + return(n == 0); } + + static int xw_end(Void) { - if(f__nonl == 0) - (*f__putn)('\n'); + 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(0); + return n; } + + static int xw_rev(Void) { - if(f__workdone) (*f__putn)('\n'); + int n = 0; + if(f__workdone) { + n = f__putbuf('\n'); + f__workdone = 0; + } f__hiwater = f__recpos = f__cursor = 0; - return(f__workdone=0); + return n; } #ifdef KR_headers |