%%s 0/0/0 %%d D 1.1 25-Mar-82 12:11:00 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- prlabl.r 1516 asc 25-mar-82 08:18:06 v1.1 (sw-tools v1.1) #-h- main 1443 asc 25-mar-82 08:17:58 v1.1 (sw-tools v1.1) define(MAX_WIDTH,20) define(DEFAULT_WIDTH,7) # 1.5" labels using 6 pitch printer define(COMMENT,'#') define(MIN_HEAD,1) define(MIN_TAIL,1) DRIVER(prlabl) character buf(MAXLINE), msg(MAXLINE, MAX_WIDTH), blnkln(2) integer status, i, width, head, tail, limit integer getlin, equal, getarg, ctoi data blnkln/'@n', EOS/ call query("usage: prlabl [-width] MAX_WIDTH) limit = MAX_WIDTH } repeat { repeat { status = getlin(buf, STDIN) if (status == EOF) break if (equal(buf, blnkln) == NO) break } if (status == EOF) break i = 1 for ( ; status != EOF; status=getlin(buf,STDIN)) if (buf(1) == COMMENT) next else if (equal(buf, blnkln) == YES) break else if (i > limit) next else { call scopy(buf, 1, msg(1, i), 1) i = i + 1 } width = i - 1 if (width <= 0) next head = MIN_HEAD + (limit - width) / 2 tail = limit + MIN_HEAD + MIN_TAIL - head - width for (i=1; i <= head; i=i+1) call putch('@n', STDOUT) for (i=1; i <= width; i=i+1) call putlin(msg(1, i), STDOUT) for (i=1; i <= tail; i=i+1) call putch('@n', STDOUT) } until (status == EOF) DRETURN end #-h- prlabl.fmt 977 asc 25-mar-82 08:18:07 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Prlabl (1) 11-Mar-82 format labels for printing .sy prlabl [-width]