Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/badkey.bli
There are 11 other files named badkey.bli in the archive. Click here to see a list.
%TITLE 'BADKEY - test for bad key'
MODULE BADKEY (				! Test for bad key
		IDENT = '3-004'			! File: BADKEY.BLI Edit: CJG3004
		) =
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:
!
!	Test for a bad key.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: 6-AUG-1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 18-FEB-1981.  This module was created by
!	extracting routine EDT$$TST_BADK  from module EDTCTR.
! 1-002	- Regularize headers and fix file name.  JBS 04-Mar-1981
! 1-003	- Change range check, for new implementation of defined keys.
!	   JBS 12-Aug-1982
! 1-004	- Don't allow GOLD digit.  JBS 16-Aug-1982
! 1-005	- Add conditional for VT220 support.  JBS 11-Feb-1983
!
! 3-001 - Update for Tops20.  GB 26-Apr-1983
! 3-002 - Fix non-VT220 test for GOLD digit. CJG 11-Jul-1983
! 3-003 - Remove VT220 conditional to speed up code. CJG 25-Nov-1983
! 3-004 - Modify ASSERT macro to include error code. CJG 30-Jan-1984
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$TST_BADK;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

LIBRARY 'EDTSRC:KEYPADDEF';

LIBRARY 'EDTSRC:TRANSLATE';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$TST_BADK  - test for bad key'

GLOBAL ROUTINE EDT$$TST_BADK (			! Test for bad key
    KEY						! the key to test
    ) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Test for a bad key.
!
! FORMAL PARAMETERS:
!
!  KEY			The key to test
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE
!
!	1 = key is bad, 0 = key is good
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL
	CHAR_INFO : BLOCKVECTOR [256, 1];	! Information about characters


    ASSERT (1, .KEY LEQ K_KEY_MAX);

    IF ((.KEY LSS K_KPAD_BASE) AND (.KEY NEQ ASC_K_DEL) AND (.KEY GEQ ASC_K_SP)) THEN RETURN (1);

    IF ((.KEY GEQ K_GOLD_BASE) AND (.KEY LSS K_GOLD_BASE + 256))
    THEN
	BEGIN

	IF .CHAR_INFO [.KEY - K_GOLD_BASE, CI_DIG] THEN RETURN (1);

	END;

    RETURN (0);
    END;					! of routine EDT$$TST_BADK

!<BLF/PAGE>
END						! of module EDT$BADKEY

ELUDOM