/* ED5.C */ #include ed0.c #include ed1.ccc int fmttab; int fmtdev; int fmtwidth; int fmtcol[MAXLEN1]; fmtassn(listflag) int listflag; { if (listflag==YES) { fmtdev=YES; fmtwidth=LISTW; } else { fmtdev=NO; fmtwidth=SCRNW1; } } fmtadj(buf,minind,maxind) char *buf; int minind,maxind; { int k; fmtcol[0]=0; k=minind; while (k=fmtwidth) { return; } outxy(fmtcol[i],outyget()); while (ifmtwidth) { break; } fmtoutch(buf[i],fmtcol[i]); i++; } if (fmtcol[i]fmtwidth) { break; } fmtoutch(c,col); col=col+k; } return(col); /* fmtsout() now returns column value */ } fmtchlen(c,col) char c; int col; { if (c==TAB) { return(fmttab-(col%fmttab)); } else if (c<32) { return(2); } else { return(1); } } fmtoutch(c,col) char c; int col; { int k; if (c==TAB) { k=fmtchlen(TAB,col); while ((k--)>0) { fmtchdev(' '); } } else if (c<32) { fmtchdev('^'); fmtchdev(c+64); } else { fmtchdev(c); } } fmtchdev(c) char c; { if (fmtdev==YES) { syslout(c); } else { outchar(c); } } fmtcrlf() { if (fmtdev==YES) { syslout(CR); syslout(LF); } else { outxy(0,SCRNL1); syscout(CR); syscout(LF); } } fmtset(n) int n; { fmttab=max(1,n); } .