.MCALL .MODULE .MODULE CKOPN,VERSION=01,COMMENT= ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .ENABL GBL,LC .SBTTL Macro definitions .MCALL FDBDF$, FERDF$, DEFIN$ FDBDF$ ;Define FDB offsets FERDF$ ;Define file service error codes DEFIN$ ;Definitions for IND files .PSECT $CKOPN .SBTTL $CKOPR CHECK FILE OPENED FOR READ .SBTTL $CKOPW CHECK FILE OPENED FOR WRITE .SBTTL $CKOPN CHECK FILE OPENED ;+ ;$CKOPR ;This routine checks the file indicated by the specified FDB for read access. ; ;$CKOPW ;This routine checks the file indicated by the specified FDB for write access. ; ;$CKOPN ;This routine checks the file indicated by the specified FDB for open status. ; ; Input: R1 -> Address of FDB ; ; Output: R1 -> Address of FDB ; C-bit set if error ;- .ENABL LSB $CKOPR::CALL $CKOPN ;If the file open? BCS 3$ ;Branch if no BITB #F.OPNR,F$FLGS(R1) ;Is the file open for read? BNE 2$ ;Branch if yes MOV #,R0 ;File accessed for write BR 1$ $CKOPW::CALL $CKOPN ;Is the file open? BCS 3$ ;Branch if no BITB #F.OPNW,F$FLGS(R1) ;Is the file opened for write? BNE 2$ ;Branch if yes MOV #,R0 ;File accessed for read BR 1$ $CKOPN::TSTB F$FLGS(R1) ;Is the file open? BNE 3$ ;Branch if yes MOV #,R0 ;No file opened on channel 1$: MOV R0,F$ERR(R1) ;Save error code SEC BR 3$ 2$: CLC ;Success 3$: RETURN .DSABL LSB .END