.TITLE GETFID - SUBROUTINE TO RETURN FILE ID. .PSECT DATA,LONG ; ; Calling sequence: ; ; CALL GETFID ( FILEN, FID ) where ; ; FILEN : The address of a string descriptor for the file name ; ; FID : The address of a 3 word integer array for the return ; file ID. ; Note: ; GETFID can also be called as an integer function so that the ; return status can be tested. ; ; STATUS = GETFID ( FILEN, FID ) ; INFAB: $FAB NAM=NAMBLK,FNA=NAME INRAB: $RAB FAB=INFAB NAMBLK: $NAM NAME: .BLKB 63 ;Max file name size=63 .PSECT CODE GETFID:: .WORD ^M MOVL 4(AP),R7 ;Get fnam desc. addr. MOVB (R7),W^INFAB+FAB$B_FNS ;Set file name size MOVZBL (R7),R6 ;Byte count to r6 MOVL 4(R7),R7 ;Get string addr. MOVC3 R6,(R7),W^NAME ;Move name to "name" $OPEN FAB=W^INFAB ;Open file BLBC R0,EXIT ;If lbc report error MOVL 8(AP),R3 ;Get addr. for fid MOVAL W^NAMBLK,R2 ;Get nameblk address MOVW W^NAM$W_FID_NUM(R2),(R3)+ ;Move fid MOVW W^NAM$W_FID_SEQ(R2),(R3)+ ;Move file seq # MOVW W^NAM$W_FID_RVN(R2),(R3) ;Move file rel vol # $CLOSE FAB=W^INFAB ;Close file BLBC R0,EXIT ;If lbc report error MOVZWL #SS$_NORMAL,R0 ;Set success ret code EXIT: RET .END