#-h- usersym 112 asc 29-oct-80 00:07:27 tools # symbol definitions used by: users # should be placed on a file named usersym # define(RIGHT_MARGIN,80) #-h- users.r 1055 asc 29-oct-80 00:07:28 tools #-h- main 1000 asc 29-oct-80 00:07:25 tools include usersym subroutine main character buf(MAXLINE), file(FILENAMESIZE), obuf(MAXLINE) integer getlin, open, length, tty, getarg, equal integer nxtcol, packit, int, i string quest "?" packit = tty(STDOUT) if (getarg(1, file, FILENAMESIZE) != EOF) if (equal(file, quest) == YES) call error("usage: users [-1].") else if (file(1) == MINUS & file(2) == DIG1) packit = NO call adrfil(file) if (packit == YES) call inpack(nxtcol, RIGHT_MARGIN, obuf, STDOUT) int = open(file, READ) if (int != ERR) { while (getlin(buf, int) != EOF) { for (i=1; buf(i)!=BLANK & buf(i)!=TAB & buf(i) != ATSIGN; i=i+1) file(i) = buf(i) file(i) = EOS if (packit == YES) call dopack(file, nxtcol, RIGHT_MARGIN, obuf, STDOUT) else { call putlin(file, STDOUT) call putch(NEWLINE, STDOUT) } } if (packit == YES) call flpack(nxtcol, RIGHT_MARGIN, obuf, STDOUT) call close(int) } else call remark('Cannot open user file!') return end