%%s 0/0/0 %%d D 1.1 25-Mar-82 12:05:38 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- cprsym 244 asc 25-mar-82 07:51:24 v1.1 (sw-tools v1.1) # symbols for compress and expand tools # put on a file called 'cprsym' # Used only by compress and expand #must have RCODE > (MAXCHUNK + BLANK) or RCODE = 0 define(RCODE,125) define(MAXCHUNK,arith(RCODE,-,incr(' '))) define(THRESH,4) #-h- expand.r 1080 asc 25-mar-82 07:51:26 v1.1 (sw-tools v1.1) #-h- main 450 asc 25-mar-82 07:51:01 v1.1 (sw-tools v1.1) ## expand - uncompress input files include cprsym DRIVER(expand) character buf(MAXLINE) integer getarg, open integer i call query("usage: expand [file] ...") for (i=1; getarg(i, buf, MAXLINE) != EOF; i=i+1) { if (buf(1) == '-' & buf(2) == EOS) int = STDIN else { int = open(buf,READ) if (int == ERR) call cant(buf) } call xpd (int) if (int != STDIN) call close(int) } if (i == 1) call xpd(STDIN) DRETURN end #-h- xpd 484 asc 25-mar-82 07:51:04 v1.1 (sw-tools v1.1) ## xpd - uncompress file -int- subroutine xpd (int) character getch character c, code while(getch(code,int) != EOF) if (code == RCODE) #expand repetition { if (getch(c,int) == EOF) break if (getch(code,int) == EOF) break for (code = code - ' '; code >0; code = code - 1) call putc(c) } else { for (code = code - ' '; code > 0; code = code - 1) { if (getch(c,int) == EOF) break call putc(c) } if (c == EOF) break } return end #-h- expand.fmt 467 asc 25-mar-82 07:51:27 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Expand (1) 15-Jan-79 uncompress input files .sy expand [file] ... .ds Expand expands files previously compressed by 'cpress'. If no input files are given, or if the filename '-' appears, input will be read from the standard input. .fl .sa cpress .di A message is printed if an input file cannot be opened; further processing is terminated. .au Original from Kernighan & Plauger's 'Software Tools', with minor modifications by Debbie Scherrer. .bu %%E 1