.MCALL .MODULE .MODULE IFPROT,VERSION=04,COMMENT=,IDENT=No,LIB=Yes ; 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. .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; IFPROT ; ; ENVIRONMENT: ; ; This routine can be used by any job running in a single-job ; or multi-job environment. It uses "TRAP" to provide error ; processing. ; ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .FPROT ; FPROT programmed request. ; ; EQUATED SYMBOLS: ; S.PROT = 1 ; .FPROT's set file protection action value. ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRP0 ; Entry point to EMT error conversion routine. .GLOBL $NXADR ; Entry point to next address routine. .GLOBL $NXVAL ; Entry point to next value routine. .GLOBL $SYSLB ; Include system library work area. .WEAK $MSARG ; TRAP code for missing argument .SBTTL IFPROT - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IFPROT function sets or removes file protection for a specified ; file. ; ; CALLING SEQUENCE: ; ; i = IFPROT( chan, dblk [,prot] ) ; ; INPUT PARAMETERS: ; ; R5 - address of IFPROT's argument block ; ; 0(R5) - argument count of IFPROT call ; 2(R5) - address of number of channel to use for protecting file ; 4(R5) - address of four-word Radix-50 descriptor of file ; 6(R5) - address of file protection action to take; if argument is ; omitted, value is defaulted to 1 (set protection). ; ; OUTPUT PARAMETERS: ; ; R0 - file protection status ; ; ROUTINE VALUE: ; ; 0 - no error seting/removing file protection ; 1 - channel ('chan') is already in use ; 2 - file specified was not found ; 3 - invalid file operation ; 4 - invalid value for 'prot' ; ; -- .PSECT SYS$I FPROT:: ; Entry point to IFPROT routine. IFPROT:: ; Entry point to IFPROT routine. MOV (R5)+,R4 ; R4 <- argument count. ; ; Get channel no. for use in protecting file ; CALL $NXVAL ; Get 'chan' argument; it's returned in R0 BCS 10$ ; If CS, error - 'chan' argument wasn't ; supplied; report missing argument in call. MOV R0,R3 ; R3 <- channel no. to use for .FPROT. CALL $NXADR ; Get -> 'dblk' argument; it's returned in R0 BCS 10$ ; If CS, error - 'dblk' argument wasn't ; supplied; report missing argument in call. MOV R0,R2 ; R2 <- address of spec of file to protect. MOV #1,R0 ; Default 'prot' to 1 - in case it's omitted. CALL $NXVAL ; Get 'prot' argument; it's returned in R0. MOV R0,-(SP) ; Store 'prot' in FPROT's argument block. CMP -(SP),-(SP) ; Allocate remaining space for FPROT's ; argument block. .FPROT SP,R3,R2,PROT=<>; Protect/unprotect named file. CALL $ERRP0 ; Get and convert any errors (status in R0). ADD #6,SP ; Purge stack of argument block. RETURN ; Return to caller with status in R0. 10$: TRAP $MSARG ; Handle any missing arguments in call RETURN .END