%%s 0/0/0 %%d D 1.1 25-Mar-82 12:10:24 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- os.r 1768 asc 25-mar-82 08:15:24 v1.1 (sw-tools v1.1) #-h- defns 213 asc 25-mar-82 08:15:14 v1.1 (sw-tools v1.1) ## definitions for overstrike tool # put on a file named 'defns' # Used only by overstrike define(NOSKIP,'+') #suppress carriage-return/line feed define(SKIP,' ') define(NEWPAGE,'1') # top of page on ^L #-h- main 612 asc 25-mar-82 08:15:14 v1.1 (sw-tools v1.1) ## os - convert backspaces into multiple lines DRIVER(os) character buf(MAXLINE) integer getarg, open, assign integer i call query("usage: os [file] ...") call filnfo(STDOUT, buf, i) if (assign(buf, STDOUT, PRINT) == ERR) call error("Cannot reset standard output to PRINT carriage control.") for (i=1; ; i=i+1) { if (getarg(i,buf,MAXLINE) == EOF) { if (i != 1) break int = STDIN } else if (buf(1) == '-' & buf(2) == EOS) int = STDIN else { int = open(buf,READ) if (int == ERR) call cant(buf) } call overs (int) if (int != STDIN) call close(int) } DRETURN end #-h- overs 724 asc 25-mar-82 08:15:15 v1.1 (sw-tools v1.1) ## overs - convert backspaces into multiple lines from file -int- subroutine overs(int) character getch character c integer col, newcol, int col = 1 repeat { newcol = col while (getch(c,int) == BACKSPACE) #eat up backspaces newcol = max(newcol-1, 1) if (newcol < col) #start overstrike line { call putc('@n') call putc(NOSKIP) for (col=1; col