;+ ; Name: GINUSR ; Author: T. R. WYANT ; Creation Date: 27-FEB-1987 ;$ 27-Feb-1987 T. R. Wyant Debugged. ; ; Revision: Date Name Description ; ; Description: ; ; This subroutine will return the user account block ; for the terminal desired, using the GIN$ directive. ; Currently, the user's last name is stored in 14. bytes ; starting at byte 75. of the buffer, and the user's ; first initial is stored at byte 89. of the buffer. ; ; >>>>>>>>>>>>>>>>>>>>>>>>> Note <<<<<<<<<<<<<<<<<<<<<<<<< ; >> << ; >> The GIN$ directive is not supported by << ; >> DEC. The functionality gained by calling << ; >> this routine should not be essential. << ; >> << ; >>>>>>>>>>>>>>>>>>>>>>>>> Note <<<<<<<<<<<<<<<<<<<<<<<<< ; ; This subroutine is called in FORTRAN by ; ; CALL GINUSR (USRBUF, USRSIZ, USRDEV, USRUNT, STATUS) ; ; The first two arguments are the only required ones. ; ; ; Module Dictionary: ; ; Inputs: ; ; Control: ; ; USRSIZ INTEGER*2 size of the user buffer, ; in words. A buffer of at least 50. ; words must be provided. ; ; USRDEV INTEGER*2 device name, in ASCII, of ; the terminal whose information is to ; be returned. If omitted or zero, the ; user's TI: is what is checked. The ; task must be privileged to get the ; information from another terminal. ; ; USRUNT INTEGER*2 device unit number of the ; terminal whose information is to be ; returned. If omitted, it defaults to ; zero. ; ; Data: ; ; <<< None !!! >>> ; ; ; Outputs: ; ; Control: ; ; STATUS INTEGER*2 directive status returned ; by the GIN$S call. ; ; Data: ; ; USRBUF A word aligned buffer containing the ; user account block for the terminal ; requested. ; ; ; Task Communication: ; ; <<< None !!! >>> ; ; ; File I/O: ; ; <<< None !!! >>> ; ; ; Common areas used: ; ; <<< None !!! >>> ; ; ; ;MC ; ;MWC ;- .DSABL GBL .GLOBL $DSW, $SAVVR .MCALL GIN$S .ASECT .=0 .BLKW 1 ; Number of arguments. USRBUF: .BLKW 1 ; User buffer (word aligned). USRSIZ: .BLKW 1 ; User buffer size, in words (word). USRDEV: .BLKW 1 ; User device name (word). USRUNT: .BLKW 1 ; User unit number (word). STATUS: .BLKW 1 ; User status. NARGS =: ./2 ; Number of arguments. .PSECT PURCOD RO,I,LCL,REL,CON GINUSR:: ;; ; Preserve some working registers; ; JSR R2,$SAVVR ;; ; Get the user device name if passed; ; CLR R0 ; Assume no device name. CLR R1 ; Assume no unit, either. CMPB (R5),#USRDEV/2 ; Did we get a device name? BLO 20$ ; If not, skip out. CMP USRDEV(R5),#-1 ; Was it a dummy argument? BEQ 20$ ; If so, skip out. MOV @USRDEV(R5),R0 ; Get the device name. BEQ 20$ ; If null, don't bother with unit. CMPB (R5),#USRUNT/2 ; Did we get a unit number? BLO 20$ ; If not, skip out. CMP USRUNT(R5),#-1 ; Was it a dummy argument? BEQ 20$ ; If so, skip out. MOV @USRUNT(R5),R1 ; Get the unit number. 20$: ; Device name loaded. ;; ; Invoke GIN with: ; Subfunction 5 = get user account block; ; The address of the user's buffer; ; The size of the buffer in words; ; The terminal name; ; The terminal unit number; ; Directive status of IE.PRI (-16.)is returned if ; a non-privileged user specifies a terminal. ; Directive status of IE.IDU (-92.) is returned if ; the specified device is not a terminal or ; if there is no UAB for the device. ; GIN$S #5., USRBUF(R5), @USRSIZ(R5), R0, R1 ;; ; IF (the status argument was passed) THEN ; Return the directive status; ; CMPB (R5),#STATUS/2 ; Did we get a device name? BLO 40$ ; If not, skip out. CMP STATUS(R5),#-1 ; Was it a dummy argument? BEQ 40$ ; If so, skip out. MOV $DSW,@STATUS(R5) ; Get the status. 40$: ; Got status. ;; ; RETURN; ; END. ; RETURN ; Return, restoring registers. .END