Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/message.bli
There are 10 other files named message.bli in the archive. Click here to see a list.
 %TITLE 'MESSAGE - message text for TOPS20'
MODULE MESSAGE (				! Message text for TOPS20
		IDENT = '1-004'			! File: MESSAGE.B36 Edit: CJG1004
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 BY
!	      DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!		ALL RIGHTS RESERVED.
!
! 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:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	This module contains the error messages and a routine which
!	locates a message by number and puts it out though the formatting
!	routines.
!
! ENVIRONMENT:	TOPS20 only.
!
! AUTHOR: Graham Beech, CREATION DATE: 21-January-1983
!
! MODIFIED BY:
!
! 1-001 - Original.  GB 21-Jan-1983
! 1-002 - Add updates from V3 sources.  GB 20-Jun-1983
! 1-003 - Modify the table layout to improve performance. CJG 20-Jun-1983
! 1-004 - Simplify and fix code for system errors. CJG 23-Dec-1983
!--

%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$MSG_TOSTR : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

REQUIRE 'SYS:JSYS';

!
! MACROS:
!

MACRO
    MESSAGE_SEVERITY =	34, 2, 0 %,
    MESSAGE_LENGTH =	27, 7, 0 %,
    MESSAGE_NUMBER =	18, 9, 0 %,
    MESSAGE_TEXT =	 0,18, 0 %;

!+
! EDT messages
!-
!+
! Lay out the text for the error messages.  The source is in file
! ERRMSG.REQ.
!-

MACRO
    ERR [NAME, SEVERITY, TEXT, ENAME] =
 
	FLD (%NAME ('ERR_', NAME), %O'000777000000') +
	FLD (%CHARCOUNT (TEXT),    %O'177000000000') +
	FLD (UPLIT (%ASCIZ TEXT),  %O'000000777777') %;

BIND
    MESSAGE_INFO = UPLIT (ERROR_MESSAGES) : BLOCK;

UNDECLARE %QUOTE
    ERR;

!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
!--

%SBTTL 'EDT$$MSG_TOSTR  - format a message'

GLOBAL ROUTINE EDT$$MSG_TOSTR (			! Format a message
    MESS_NUM					! Message number
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Format a message, given its number.
!
! FORMAL PARAMETERS:
!
!  MESS_NUM		The number of the message to format
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$FMT_DCML,
	EDT$$FMT_STR;

!+
! If this is a system eror message, then get the error string, find its length
! and print it on the terminal.
!-

    IF (.MESS_NUM GTR $ERBAS)
    THEN
	BEGIN

	LOCAL
	    PTR,
	    TEMP : VECTOR [CH$ALLOCATION (80)];

	PTR = CH$PTR (TEMP);
	_ERSTR (.PTR, %O'400000000000' + .MESS_NUM, 0; PTR);
	EDT$$FMT_STR (CH$PTR (TEMP), CH$DIFF (.PTR, CH$PTR (TEMP)));
	RETURN;
	END;

!+
! If there is no message in the table, arrange to print the error number in decimal.
!-

    IF (.MESS_NUM GTR %NUMBER (ERROR_CODE))
    THEN
	BEGIN
	EDT$$FMT_STR (CH$PTR (UPLIT ('Error: ')), 7);
	EDT$$FMT_DCML (.MESS_NUM);
	RETURN;
	END;

!+
! We have found a message, format it.
!-

    EDT$$FMT_STR (CH$PTR (.MESSAGE_INFO [.MESS_NUM - 1, MESSAGE_TEXT]),
		  .MESSAGE_INFO [.MESS_NUM - 1, MESSAGE_LENGTH]);
    RETURN;
    END;


END
ELUDOM