%include "RWho.Inc" %include "C_Strings.Inc" %include "U_DateTIme.Inc" %recordformat desc fm(%integer l, a) %recordformat addr lims fm(%integer start, finish) %systemintegerfnspec mgblsc(%record(addr lims fm)%name inadr, retadr, %integer acmode, flags, %record(desc fm)%name name, %integer ident, relpag) %constinteger SEC gbl = 16_00000001 !constinteger SEC crf = 16_00000002 %constinteger SEC dzro = 16_00000004 %constinteger SEC wrt = 16_00000008 !constinteger SEC perm = 16_00004000 %constinteger SEC sysgbl = 16_00008000 !constinteger SEC pfnmap = 16_00010000 %constinteger SEC expreg = 16_00020000 %constinteger SEC pagfil = 16_00080000 %systemroutinespec exit(%integer reason) %externalroutinespec dump(%bytename start, %integer bytes) %ownrecord(rwho tables fm)%name rwho tables == 0 %routine map section %record(addr lims fm) a = 0 %record(desc fm) d %integer status d_l = length(rwho tables name); d_a = addr(rwho tables name) + 1 status = mgblsc(a, a, 0, SEC sysgbl ! SEC expreg, d, 0, 0) exit(status) %if status & 1 = 0 printstring("Section at "); phex(a_start) printstring(" .. "); phex(a_finish); newline rwho tables == record(a_start) %end %routine display packet(%record(rwho fm)%name rwho) %record(rwho user fm)%name U %string(63) s %integer i printstring("Sent at ") printstring(UNIX datetime(rwho_send time)) C to Imp(rwho_hostname(1), s) printstring(" from "); printstring(s) printstring(", users "); write(rwho_n users, 0) printstring(", up since ") printstring(UNIX datetime(rwho_boot time)) newline %for i = 1, 1, rwho_n users %cycle U == rwho_u(i) C to Imp(U_username(1), s); length(s) = 8 %if length(s) > 8 printstring(s); spaces(11 - length(s)) printstring(" on ") C to Imp(U_terminal(1), s) printstring(s); spaces(11 - length(s)) printstring(" at "); printstring(UNIX datetime(u_logon time)) printstring(", idle "); phex(u_idle time) newline %repeat %end %begin %record(rwho fm)%name r %integer i map section %for i = 1, 1, rwho slots %cycle r == rwho tables_r(i) display packet(r) %repeat %end %of %program