.TITLE GDF_OPNBDF ;++ ; OPNBDF - Open Bulk Data File ; ; This routine is used to open an EXISTING Bulk Data File for ; subsequent processing. The filename, logical or physical, is ; supplied by the calling program and the file is opened by RMS ; using the User File Open option. This restricts the access to ; the file (on the assigned channel) to the QIO and file-mapping ; system services; no RMS routines can be used. However, the ; file can still be accessed on another channel for RMS process- ; -ing, as it is opened for file sharing. ; ; The file will be opened for read/only access if the protection ; does not allow read/write operations to be performed. ; ; If the bulk data file is opened successfully, the I/O channel ; number is returned to the calling program. ; ; CALL GDF_OPNBDF(NAME,IOCHAN,RDONLY,STATUS) ; ; Input argument: ; --------------- ; NAME: CHARACTER expression: Name of Bulk Data File. ; ; Output arguments: ; ----------------- ; IOCHAN: INTEGER variable: I/O channel assigned to file. ; RDONLY: LOGICAL variable: Protection indicator ; .TRUE. Open for Readonly/Shared ; .FALSE. Open for Read/Write not shared ; STATUS: INTEGER variable: Status return. ; ;-- NAME=4 IOCHAN=8 RDONLY=12 STATUS=16 $RMSDEF BDFFAB: $FAB FOP=, - SHR=, - FAC=, - NAM=BDFNAM BDFNAM: $NAM .ENTRY GDF_OPNBDF,^M<> ; 11-Jul-1988 T.Forveille. Entry mask was incorrect: since this routine ; uses a MOVC3, registers R0 to R5 are overwritten ; .ENTRY GDF_OPNBDF,^M MOVL NAME(AP),R0 ;addr of NAME descr MOVB 00(R0),BDFFAB+FAB$B_FNS ;size of NAME string MOVL 04(R0),BDFFAB+FAB$L_FNA ;addr of NAME string BLBC @RDONLY(AP),30$ ;Branch if not readonly ; BICB2 #FAB$M_NIL,BDFFAB+FAB$B_SHR ;Clear SHR field BICB2 #FAB$M_PUT,BDFFAB+FAB$B_FAC ;clear FAC field $OPEN FAB=BDFFAB ;attempt to open file BISB2 #FAB$M_GET,BDFFAB+FAB$B_SHR ;reset SHR field BLBC R0,20$ ;abort if open failed 10$: MOVL BDFFAB+FAB$L_STV,@IOCHAN(AP) ;return IOCHAN JMP 20$ 30$: BISB2 #FAB$M_PUT,BDFFAB+FAB$B_FAC ;reset FAC field BISB2 #FAB$M_NIL,BDFFAB+FAB$B_SHR ;allow no other operation $OPEN FAB=BDFFAB ;attempt to open file BLBS R0,10$ ;branch if successful 20$: MOVL BDFFAB+FAB$L_STS,@STATUS(AP) ;return STATUS RET .END