%%s 3/3/110 %%d D 1.6 24-Feb-86 22:52:06 dpm 6 5 %%c Removed '$' which somehow got inserted at the beginning of the file... %%s 17/4/96 %%d D 1.5 24-Feb-86 18:33:22 dpm 5 4 %%c Made a single version which is compatible with VMS V3.x and V4.x using %%c conditional VMSV3 to select V3.x-flavored code. %%s 6/3/94 %%d D 1.4 22-Feb-86 17:39:17 dpm 4 3 %%c Filtered out null usernames. Replaced putlnl(""@", ...) call with 2 calls %%c to putch. RatFor's string handling seems to have been damaged by VMS %%c FORTRAN "bug fixes". %%s 30/35/67 %%d D 1.3 02-Jan-85 12:10:47 graves 3 2 %%c Modified to reflect version 4 offsets in sysuaf.dat. Also separated fetching %%c of ASCIZ strings into a separate, callable function, extasciz. %%s 6/7/96 %%d D 1.2 28-Jul-83 22:56:13 tools 2 1 %%c Converted for loops with [ ; ] multi-statement syntax to the comma- %%c separated version for use with the new ratfor. %%s 0/0/0 %%d D 1.1 04-Apr-82 13:03:15 tools 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 %%D 2 #-h- addr.r 2421 asc 04-apr-82 13:01:38 tools #-h- main 2363 asc 04-apr-82 13:01:28 tools #-h- main 2194 asc 04-apr-82 12:28:50 tools %%E 2 %%I 2 %%D 3 #-h- addr.r 2375 asc 28-jul-83 22:55:02 tools (lblh csam sventek) #-h- main 2297 asc 28-jul-83 22:44:47 tools (lblh csam sventek) %%E 3 %%E 2 %%D 3 define(START_USERNAME,arith(16%0,+,1)) define(START_DIRECTORY,arith(16%20,+,1)) define(START_DEVICE,arith(16%40,+,1)) define(START_COMMENT,arith(16%7e,+,1)) define(END_COMMENT,arith(16%9d,+,1)) define(MEMBER_UIC,arith(8%34,+,1)) define(GROUP_UIC,arith(8%36,+,1)) %%E 3 %%I 3 %%D 4 #-h- addr.r 2323 asc 02-jan-85 12:09:43 graves (wayne graves) #-h- main 1951 asc 02-jan-85 12:07:34 graves (wayne graves) %%E 4 %%I 4 %%D 5 #-h- addr.r 2393 asc 22-feb-86 17:32:51 dpm (dave martin) #-h- main 2025 asc 22-feb-86 17:29:31 dpm (dave martin) %%E 5 %%E 4 %%I 5 %%D 6 #-h- addr.r 2744 asc 24-feb-86 18:31:00 dpm (dave martin) #-h- main 2376 asc 24-feb-86 18:29:56 dpm (dave martin) $ifdef(VMSV3) %%E 6 %%I 6 #-h- addr.r 2743 asc 24-feb-86 22:50:41 dpm (dave martin) #-h- main 2375 asc 24-feb-86 22:50:29 dpm (dave martin) ifdef(VMSV3) %%E 6 define(START_USERNAME,arith(16%0,+,1)) define(START_DIRECTORY,arith(16%20,+,1)) define(START_DEVICE,arith(16%40,+,1)) define(START_COMMENT,arith(16%7e,+,1)) define(END_COMMENT,arith(16%9d,+,1)) define(MEMBER_UIC,arith(8%34,+,1)) define(GROUP_UIC,arith(8%36,+,1)) define(USER_SIZE,13) elsedef %%E 5 define(START_USERNAME,arith(16%4,+,1)) define(START_DIRECTORY,arith(16%94,+,1)) define(START_DEVICE,arith(16%74,+,1)) define(START_COMMENT,arith(16%54,+,1)) define(MEMBER_UIC,arith(16%24,+,1)) define(GROUP_UIC,arith(16%26,+,1)) %%E 3 %%I 5 define(USER_SIZE,21) enddef %%E 5 DRIVER(addr) character buf(5000) character member(2), group(2) integer igroup, imember equivalence (igroup, group(1)), (imember, member(1)) %%D 3 character user(13), direct(100), device(100), comment(100), uic(20) %%E 3 %%I 3 %%D 5 character user(21), direct(100), device(100), comment(100), uic(20) %%E 5 %%E 3 %%I 5 character user(USER_SIZE), direct(100), device(100), comment(100), uic(20) %%E 5 character file(FILENAMESIZE) filedes fd filedes open integer readf, length, equal, getarg integer n integer i, j, m integer count string def_file "sys$system:sysuaf.dat" string defalt "default" string sysdisk "sys$sysdisk:" count = 0 if (getarg(1, file, FILENAMESIZE) == EOF) call strcpy(def_file, file) fd = open(file, READ) if (fd == ERR) call cant(file) repeat { n = readf(buf, 5000, fd) if (n == EOF) break i = START_USERNAME %%D 2 for (j=1; j <= 12; [j=j+1; i=i+1]) %%E 2 %%I 2 %%D 3 for (j=1; j <= 12; j=j+1, i=i+1) %%E 3 %%E 2 %%I 3 %%I 4 if( buf(1) == EOS ) next # no UserName %%E 4 %%D 5 for (j=1; j <= 20; j=j+1, i=i+1) %%E 5 %%E 3 %%I 5 for (j=1; j <= USER_SIZE-1; j=j+1, i=i+1) %%E 5 user(j) = buf(i) user(j) = EOS for (j = length(user); j > 0; j = j - 1) if (user(j) != ' ') break user(j+1) = EOS call fold(user) %%D 3 i = START_DIRECTORY m = buf(i) i = i + 1 %%E 3 %%D 2 for (j=1; j <= m; [j=j+1; i=i+1]) %%E 2 %%I 2 %%D 3 for (j=1; j <= m; j=j+1, i=i+1) %%E 3 %%E 2 %%D 3 direct(j) = buf(i) direct(j) = EOS i = START_DEVICE m = buf(i) i = i + 1 %%E 3 %%D 2 for (j=1; j <= m; [j=j+1; i=i+1]) %%E 2 %%I 2 %%D 3 for (j=1; j <= m; j=j+1, i=i+1) %%E 3 %%E 2 %%D 3 device(j) = buf(i) device(j) = EOS %%E 3 %%I 3 call extasciz(buf, START_DIRECTORY, direct) call extasciz(buf, START_DEVICE, device) %%E 3 if (device(1) == EOS) call strcpy(sysdisk, device) call concat(device, direct, device) call fold(device) %%D 3 i = START_COMMENT m = END_COMMENT comment(1) = '"' %%E 3 %%D 2 for (j=2; i <= m; [j=j+1; i=i+1]) %%E 2 %%I 2 %%D 3 for (j=2; i <= m; j=j+1, i=i+1) %%E 3 %%E 2 %%D 3 comment(j) = buf(i) comment(j) = EOS for (j = length(comment); j > 0; j = j - 1) if (comment(j) != ' ') break j = j + 1 call chcopy('"', comment, j) %%E 3 %%I 3 call extasciz(buf, START_COMMENT, comment) %%E 3 call fold(comment) imember = 0 igroup = 0 i = MEMBER_UIC member(1) = buf(i) member(2) = buf(i+1) i = GROUP_UIC group(1) = buf(i) group(2) = buf(i+1) call fmtuic(igroup, imember, uic) if (equal(user, defalt) == NO) { call putstr(user, -15, STDOUT) call putstr(device, -24, STDOUT) call putch(' ', STDOUT) call putstr(uic, -10, STDOUT) %%D 3 call putlnl(comment, STDOUT) %%E 3 %%I 3 call putch('"', STDOUT) call putlin(comment, STDOUT) %%D 4 call putlnl("@"", STDOUT) %%E 4 %%E 3 %%I 4 call putch( '"', STDOUT) call putch( '@n', STDOUT) %%E 4 count = count + 1 } } call close(fd) call putlin("Number of records read: ", ERROUT) call putint(count, 1, ERROUT) call putch('@n', ERROUT) DRETURN end %%I 3 #-h- extasciz 224 asc 02-jan-85 12:07:36 graves (wayne graves) subroutine extasciz(buf, start, dest) character buf(ARB), dest(ARB) integer start integer i, j, len len = buf(start) for (i = start + 1, j = 1; j <= len; i = i + 1, j = j + 1) dest(j) = buf(i) dest(j) = EOS return end %%E 3 %%E 1