;******************************************************************************* ;* Module to handle logical name translation * ;******************************************************************************* ; .title WHAT_BUILDUSERS ; $lnmdef ; Get logical name constants ; .psect what_buildusers_data, con, lcl, noexe, noshr, pic, rel, wrt ; table_name: .ascid /LNM$FILE_DEV/ ; What table to translate logical ; log_name: .ascii /WHAT_USER_/ ; Prefix for logical name incomming: .blkb 256 ; Reserve a mess of storage for incoming name ; log_descr: .long 10 ; How long the logical name is .address log_name ; Where the logical name is ; equiv_name: .byte 32[255] ; Temp place to store translation equiv_len: .long 0 ; How long temp translation is ; index: .long 0 ; Temporary index into translations max_index: .long 0 ; Maximum number of translations retlength: .long 0 ; Dummy return length ; trnlnm_list: ; SYS$TRNLNM item list .word 4 ; The current index is 4 bytes .word LNM$_INDEX ; We want to get this index .address index ; Where the index is .address retlength ; Dummy return length ; .word 4 ; The maximum index is 4 bytes .word LNM$_MAX_INDEX ; We want the maximum index .address max_index ; Where to put the maximum index .address retlength ; Dummy return length ; .word 8 ; How long our string can be .word LNM$_STRING ; We want the equivalent string .address equiv_name ; Where to put the return string .address equiv_len ; Where to put the return length ; .long 0 ; End of our item list ; ; ; ;******************************************************************************* ;* What_buildusers * ;* This procedure is intended to translate the logical name "WHAT_string" * ;* string being passed in, and return all the users that are associated with * ;* it in the given buffer. * ;* * ;* Arguments - * ;* USERS - buffer to put the users returned from the logical name * ;* by descriptor * ;* LOG_NAME - logical name string to translate, "WHAT_string" is * ;* what actually gets translated. * ;* by descriptor * ;* LEN - Length return of return string * ;******************************************************************************* ; .psect what_buildusers_code, con, exe, lcl, shr, nowrt, pic, rel ; .entry what_buildusers, ^m ; movl 4(ap), r0 ; Where the node array is movl 4(r0), r11 ; Save Address of beginning of string movl 8(ap), r10 ; Save the logical name movl 12(ap), r9 ; Save the address of the return length addw2 (r10), log_descr ; Add the length of the string to translate to the prefix movc3 (r10), @4(r10), incomming ; Save the incomming string ; clrl index ; Initialize our index clrl max_index ; For cleanliness, clear the maximum index out ; $trnlnm_s - tabnam = table_name, - ; What table to translate under lognam = log_descr, - ; Where our logical name is itmlst = trnlnm_list ; Where our item list is blbs r0, 10$ brw error ; Error, get out ; 10$: cmpb #-1, max_index ; Are there any translations bneq 20$ brw error ; No there aren't, get out ; 20$: movc3 equiv_len, equiv_name, (r11) ; Save first string movb #^a/@/, (r3)+ ; Move in the dividor incl index ; Increment our index ; loop: $trnlnm_s - tabnam = table_name, - ; What table to translate under lognam = log_descr, - ; Where our logical name is itmlst = trnlnm_list ; Where our item list is blbc r0, error ; movc3 equiv_len, equiv_name, (r3) ; Save first string movb #^a/@/, (r3)+ ; Move in the dividor ; aobleq max_index, index, loop ; Keep looping until index > max_index ; movb #32, -(r3) ; Clear the last dividor subl3 r11, r3, (r9) ; Save the length we have returned movl #1, r0 ; We are successfull ret ; End of What_buildusers ; error: movc3 (r10), @4(r10), (r11) ; Just return user to work with movw (r10), (r9) ; Save the length of our string movl #1, r0 ; We are successfull ret ; End of What_buildusers ; .end