%%s 0/0/0 %%d D 1.1 25-Mar-82 12:05:32 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- entab.r 1590 asc 25-mar-82 07:50:19 v1.1 (sw-tools v1.1) #-h- main 787 asc 25-mar-82 07:49:57 v1.1 (sw-tools v1.1) ## entab - replace blanks by tabs and blanks DRIVER(entab) character getch integer nxtfil character c, buf(MAXLINE) integer tabpos, int, argct integer col, i, newcol, tabs(MAXLINE) call query("usage: entab [...] [+] [file] ...") call argtab(buf) # fetch tab info into buf call settab(buf, tabs) # set up tab stops col = 1 argct = 1 while (nxtfil(argct,int) != EOF) { repeat { newcol = col while (getch(c,int) == ' ') { newcol = newcol + 1 if(tabpos(newcol,tabs) == YES) { call putc('@t') col = newcol } } for (;col < newcol; col = col + 1) call putc(' ') if(c == EOF) { if (int != STDIN) call close(int) break } call putc(c) if(c == '@n') col = 1 else col = col + 1 } } DRETURN end #-h- nxtfil 657 asc 25-mar-82 07:49:58 v1.1 (sw-tools v1.1) ## nxtfil - get next file from argument list integer function nxtfil(argct,int) integer getarg, open, alldig integer argct, int integer flag #own character abuf(FILENAMESIZE) data flag /0/ # flag for one time through int = STDIN for ( ; ; argct = argct + 1) { nxtfil = getarg(argct,abuf,FILENAMESIZE) if (nxtfil == EOF) break if (abuf(1) == '+' | alldig(abuf) == YES) next flag = flag + 1 if (abuf(1) == '-' & abuf(2) == EOS) { int = STDIN break } else { int = open(abuf,READ) if (int != ERR) break else call cant(abuf) } } if (flag == 0) { flag = 1 nxtfil = EOS } argct = argct + 1 return end #-h- entab.fmt 707 asc 25-mar-82 07:50:22 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Entab (1) 12-Aug-81 convert spaces to tabs and spaces .sy entab [...] [+] [file] ... .ds Entab replaces strings of blanks with equivalent tabs (control-i) and blanks. It can be used to read files and produce typewriter-like text, reducing file size. Tab stops are indicated by ... (default 8, 16, ...), while + indicates tab stops every columns. Thus the command .ti +3 entab 5 21 +5 would insert tab stops at columns 5, 21, 26, etc. If no files are specified, the standard input is read. An isolated minus sign also indicates the standard input. .sa detab .br lpr .au Original from Kernighan & Plauger's 'Software Tools', with modifications by Dennis Hall. .bu %%E 1