.TITLE GETFID - SUBROUTINE TO RETURN FILE-ID .PSECT DATA,LONG ; ; ----- [LOMASKY.SYS.NUSER]GETFID.MAR ----- ; ----- Revised 06/04/90 to open file in a shared mode ----- ; ; 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. e.g. STATUS = GETFID(FILEN, FID) ; INFAB: $FAB NAM=NAMBLK,FNA=NAME,SHR= 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