#-h- os.r 1749 asc 24-apr-81 12:05:34 [002,100] #-h- defns 217 asc 24-apr-81 11:58:18 [002,100] ## definitions for overstrike tool # put on a file named 'defns' # Used only by overstrike define(NOSKIP,PLUS) #suppress carriage-return/line feed define(SKIP,BLANK) define(NEWPAGE,DIG1) # top of page on ^L #-h- main 614 asc 24-apr-81 11:50:34 [002,100] ## 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) == MINUS & 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 732 asc 24-apr-81 12:01:32 [002,100] ## 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(NEWLINE) call putc(NOSKIP) for (col=1; col