;******************************************************************************* ;* Module to handle logical name translation * ;******************************************************************************* ; .title WHAT_TRNLNM ; $lnmdef ; Get logical name constants ; .psect what_trnlnm_data, con, lcl, noexe, noshr, pic, rel, wrt ; table_name: .ascid /LNM$FILE_DEV/ ; What table to translate logical ; log_name: .ascii /WHAT_/ ; Prefix for logical name incomming: .blkb 256 ; Reserve a mess of storage for incoming name ; log_descr: .long 5 ; 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 6 ; 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_trnlnm * ;* This procedure is intended to translate the logical name "WHAT_string" * ;* string being passed in, and return all the nodes that are associated with * ;* it in the DAE_NODE_DESCR buffer. * ;* * ;* Arguments - * ;* NODES - buffer to put the nodes returned from the logical name * ;* by reference, DAE_NODE_DESCR * ;* LOG_NAME - logical name string to translate, "WHAT_string" is * ;* what actually gets translated. * ;* by descriptor * ;******************************************************************************* ; .psect what_trnlnm_code, con, exe, lcl, shr, nowrt, pic, rel ; .entry what_trnlnm, ^m ; movl 4(ap), r11 ; Where the node array is movl 8(ap), r10 ; Save the logical name 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 end ; No there aren't, get out ; 20$: addb3 max_index, #1, (r11)+ ; Save number of nodes movb equiv_len, (r11)+ ; Save first translation length movc5 equiv_len, equiv_name, #32, #6, (r11) ; Save first string movl r3, r11 ; Save new address in nodes list 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 ; movb equiv_len, (r11)+ ; Save first translation length movc5 equiv_len, equiv_name, #32, #6, (r11) ; Save first string movl r3, r11 ; Save new address in nodes list ; aobleq max_index, index, loop ; Keep looping until index > max_index movl #1, r0 ; We are successfull ; end: ret ; End of What_trnlnm ; error: pushl r0 ; Push the error returned pushal log_descr ; What logical name failed pushl #1 ; How many arguments we are passing pushl #WHAT_BADLNM ; Failure talking to the daemon calls #4, g^lib$signal ; Signal the error ; ret ; End of Trnlnm ; .end