Google
 

Trailing-Edge - PDP-10 Archives - DEC_CMS-20_V1.0_SRC - cms/sources/condit.req
There are 29 other files named condit.req in the archive. Click here to see a list.
! CONDIT.REQ  --  Declarations for condition values and handling.

!
!			  COPYRIGHT (C) 1982 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND 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.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
! TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
! CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! Facility:  CMS Library Processor
!
! Abstract:
!
!	This file contains declarations needed to deal with status and
!	condition codes in general, and declares some specific condition
!	codes internal to CMS.
!
! Environment:	Common
!
! Author:  Earl Van Horn	Creation Date:  December 31, 1979
!
!--
%if %bliss(bliss32) %then

! If the declaration
!
!	library 'SYS$LIBRARY:STARLET' ;
!
! appears in the program, it must appear before this file is included.


! Declare the fields of a condition value in such a way that they match
! the declarations in STARLET.L32 if it has been included.
!
macro
    $sts$sev = 0, 0, 3, 0 %,	! Severity code.
    $sts$suc = 0, 0, 1, 0 %,	! Success bit.
    $sts$ide = 0, 3,25, 0 %,	! Condition identification.
    $sts$msg = 0, 3,13, 0 %,	! Message number.
    $sts$cod = 0, 3,12, 0 %,	! Condition code.
    $sts$fsp = 0,15, 1, 0 %,	! Facility specific bit.
    $sts$fno = 0,16,12, 0 %,	! Facility number.
    $sts$cus = 0,27, 1, 0 %,	! Customer defined bit.
    $sts$inh = 0,28, 1, 0 % ;	! Inhibit message.

%if %identical(($sts$sev), (sts$v_severity))
%then undeclare %quote sts$v_severity ;
%fi
%if %identical(($sts$suc), (sts$v_success))
%then undeclare %quote sts$v_success ;
%fi
%if %identical(($sts$ide), (sts$v_cond_id))
%then undeclare %quote sts$v_cond_id ;
%fi
%if %identical(($sts$msg), (sts$v_msg_no))
%then undeclare %quote sts$v_msg_no ;
%fi
%if %identical(($sts$cod), (sts$v_code))
%then undeclare %quote sts$v_code ;
%fi
%if %identical(($sts$fsp), (sts$v_fac_sp))
%then undeclare %quote sts$v_fac_sp ;
%fi
%if %identical(($sts$fno), (sts$v_fac_no))
%then undeclare %quote sts$v_fac_no ;
%fi
%if %identical(($sts$cus), (sts$v_cust_def))
%then undeclare %quote sts$v_cust_def ;
%fi
%if %identical(($sts$inh), (sts$v_inhib_msg))
%then undeclare %quote sts$v_inhib_msg ;
%fi


! Now declare the fields of a condition value as a structure.
!
field
    sts$r_condition =
	set
	sts$v_severity = [$sts$sev],		! Severity code.
	    sts$v_success = [$sts$suc],		! Success bit.
	sts$v_cond_id = [$sts$ide],		! Condition identification.
	    sts$v_msg_no = [$sts$msg],		! Message number.
		sts$v_code = [$sts$cod],	! Condition code.
		sts$v_fac_sp = [$sts$fsp],	! Facility specific bit.
	    sts$v_fac_no = [$sts$fno],		! Facility number.
		sts$v_cust_def = [$sts$cus],	! Customer defined bit.
	sts$v_inhib_msg = [$sts$inh]		! Inhibit message.
	tes ;

! Now get rid of the temporary names.
!
undeclare
    %quote $sts$sev,
    %quote $sts$suc,
    %quote $sts$ide,
    %quote $sts$msg,
    %quote $sts$cod,
    %quote $sts$fsp,
    %quote $sts$fno,
    %quote $sts$cus,
    %quote $sts$inh ;


! The $STS_FULLWORD macro declares a fullword as a block that holds a
! condition value.
!
macro
    $sts_fullword =
	block[1] field(sts$r_condition)
	% ;


! Declare the values of STS$V_SEVERITY in such a way that they match
! the declarations in STARLET.L32 if it has been included.
!
literal
    $sts$war = 0,			! Warning.
    $sts$suc = 1,			! Success.
    $sts$err = 2,			! Error.
    $sts$inf = 3,			! Information.
    $sts$sev = 4 ;			! Severe error.


%if %declared(sts$k_warning)		! STARLET.L32 has been included.
%then
    %if $sts$war eql sts$k_warning
    %then undeclare sts$k_warning ;
    %fi
    %if $sts$suc eql sts$k_success
    %then undeclare sts$k_success ;
    %fi
    %if $sts$err eql sts$k_error
    %then undeclare sts$k_error ;
    %fi
    %if $sts$inf eql sts$k_info
    %then undeclare sts$k_info ;
    %fi
    %if $sts$sev eql sts$k_severe
    %then undeclare sts$k_severe ;
    %fi
%fi

%fi

! Now declare the literals for the values of STS$V_SEVERITY.
!
%if %bliss(bliss32) %then
literal
    sts$k_warning = $sts$war,		! Warning.
    sts$k_success = $sts$suc,		! Success.
    sts$k_error = $sts$err,		! Error.
    sts$k_info = $sts$inf,		! Information.
    sts$k_severe = $sts$sev ;		! Severe error.
%fi

%if %bliss(bliss36) %then
! These literals have no meaning for the 20 or 10.
! They are set to sequential numeric values for debugging
! convenience only.
literal
    sts$k_warning = 0,		! Warning.
    sts$k_success = 1,		! Success.
    sts$k_error = 2,		! Error.
    sts$k_info = 3,		! Information.
    sts$k_severe = 4;		! Severe error.
%fi

%if %bliss(bliss32) %then
! Now get rid of the temporary literals.
!
undeclare
    $sts$war,
    $sts$suc,
    $sts$err,
    $sts$inf,
    $sts$sev ;



! The $STS_VALUE macro composes a condition value.
!
keywordmacro
    $sts_value(
	severity = sts$k_severe,
	code = 0,
	fac_sp = 1,
	fac_no = 0,
	cust_def = 1,
	inhib_msg = 0) =

	    ((severity and 7) or
	     ((code and %x'FFF') ^ 3) or
	     ((fac_sp and 1) ^ 15) or
	     ((fac_no and %x'FFF') ^ 16) or
	     ((cust_def and 1) ^ 27) or
	     ((inhib_msg and 1) ^ 28))
	% ;



! The $STS_MATCH macro compares two conditions codes.
!
macro
    $sts_match(a, b) =
	begin	! $STS_MATCH
	local
	    $sts$match_a : sts$r_condition,
	    $sts$match_b : sts$r_condition ;

	$sts$match_a = (a) ;
	$sts$match_b = (b) ;
	if .$sts$match_a[sts$v_fac_sp] or .$sts$match_b[sts$v_fac_sp]
	then	! Compare the entire condition identification.
	    .$sts$match_a[sts$v_cond_id] eql .$sts$match_b[sts$v_cond_id]
	else	! Ignore the facility number.
	    .$sts$match_a[sts$v_code] eql .$sts$match_b[sts$v_code]
	end	! $STS_MATCH
	% ;

%fi


! The CMS facility number.
!
literal
    k_step_fac_no = 156 ;	! Assigned by the VMS group.


! The STEP_STATUS macro to declare status codes with the CMS facility number.
!
keywordmacro
    step_status(
	severity = sts$k_severe,
	code = 0,
	inhib_msg = 0) =

	    $sts_value(%quote severity = severity,
		       %quote code = code,
		       %quote inhib_msg = inhib_msg,
			      fac_sp = 1,
			      fac_no = k_step_fac_no,
			      cust_def = 0)

	% ;
! The following keywordmacros use step_status to define the four
! return codes

keywordmacro
    step_warning(
    	code = 0) =
    	    
    	    step_status ( severity = sts$k_warning,
    			  %quote code = code,
    			  inhib_msg = 1 )

    	% ;

keywordmacro
    step_information(
    	code = 0) =

    	    step_status ( severity =sts$k_info,
    			  %quote code = code,
    			  inhib_msg = 0 )

    	% ;

keywordmacro
    step_error(
    	code = 0) =

    	    step_status ( severity =sts$k_error,
    			  %quote code = code,
    			  inhib_msg = 1)

    	% ;

keywordmacro
    step_severe(
    	code = 0) =

    	    step_status ( severity =sts$k_severe,
    			  %quote code = code,
    			  inhib_msg = 1)

    	% ;



! CONDIT.REQ  --  LAST LINE