📄 wsfe.c
字号:
#ifndef lintstatic char *sccsid = " @(#)wsfe.c 4.1 (ULTRIX) 7/17/90";#endif lint/************************************************************************ * * * Copyright (c) 1986 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * This software is derived from software received from the * * University of California, Berkeley, and from Bell * * Laboratories. Use, duplication, or disclosure is subject to * * restrictions under license agreements with University of * * California and with AT&T. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************//************************************************************************** Modification History** David Metsky 10-Jan-86** 001 Replaced old version with BSD 4.3 version as part of upgrade.** Based on: wsfe.c 5.2 7/30/85**************************************************************************//* * write sequential formatted external */#include "fio.h"LOCAL char wsfe[] = "write sfe";extern int w_ed(),w_ned();int x_putc(),pr_put(),x_wend(),x_wnew(),x_tab();LOCAL ioflag new;s_wsfe(a) cilist *a; /*start*/{ int n; reading = NO; sequential = YES; if(n=c_sfe(a,WRITE,SEQ,wsfe)) return(n); if(curunit->url) err(errflag,F_ERNOSIO,wsfe) if(!curunit->uwrt && ! nowwriting(curunit)) err(errflag, errno, wsfe) curunit->uend = NO; if (curunit->uprnt) putn = pr_put; else putn = x_putc; new = YES; doed= w_ed; doned= w_ned; doend = x_wend; dorevert = donewrec = x_wnew; dotab = x_tab; if(pars_f()) err(errflag,F_ERFMT,wsfe) fmt_bg(); return(OK);}LOCALx_putc(c){ if(c=='\n') recpos = reclen = cursor = 0; else recpos++; if (c) putc(c,cf); return(OK);}LOCALpr_put(c){ if(c=='\n') { new = YES; recpos = reclen = cursor = 0; } else if(new) { new = NO; if(c=='0') c = '\n'; else if(c=='1') c = '\f'; else return(OK); } else recpos++; if (c) putc(c,cf); return(OK);}LOCALx_wnew(){ if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1); return((*putn)('\n'));}LOCALx_wend(last) char last;{ if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1); return((*putn)(last));}e_wsfe(){ int n; n=en_fio(); fmtbuf=NULL; return(n);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -