Google
 

Trailing-Edge - PDP-10 Archives - BB-R775E-BM - sources/edt/clrkey.bli
There are 11 other files named clrkey.bli in the archive. Click here to see a list.
 %TITLE 'CLRKEY - cancel a key definition'
MODULE CLRKEY (				! Cancel a key definition
		IDENT = '3-001'			! File: CLRKEY.BLI Edit: GB3001
		) =
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:
!
!	Cancel a key definition
!
! 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$$CAN_KDEF  from module EDTCTR.
! 1-002	- Regularize headers and fix file name.  JBS 04-Mar-1981
! 1-003 - Deallocate virtual memory for keys before cancelled. TMV 06-Aug-81
! 1-004	- Return a status code.  JBS 18-May-1982
! 1-005	- New implementation of defined keys.  JBS 13-Aug-1982
! 3-001 - Add updates from V3 source kit.  GB 27-Apr 1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$CAN_KDEF;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

LIBRARY 'EDTSRC:KEYPADDEF';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$CAN_KDEF  - cancel a key definition'

GLOBAL ROUTINE EDT$$CAN_KDEF (			! Cancel a key definition
    KEY						! Number of the key whose definition to cancel
    ) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Cancel a key definition,and deallocate virtual memory
!
! FORMAL PARAMETERS:
!
!  KEY			The number of the key whose definition to cancel
!
! IMPLICIT INPUTS:
!
!	NONE
!
! IMPLICIT OUTPUTS:
!
!	TRN_TBL
!
! ROUTINE VALUE:
!
!	EDT$_KEYNOTDEF if the key cannot be defined, 1 if it can.
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$DEA_HEAP,
	EDT$$TST_BADK;

    EXTERNAL
	TRN_TBL : VECTOR;		! The keypad translation table

    MESSAGES ((KEYNOTDEF));

    LOCAL
	KEY_PTR : REF BLOCK [ ] FIELD (KEY_DEF_FIELD),
	OLD_KEY_PTR : REF BLOCK [ ] FIELD (KEY_DEF_FIELD);

    IF EDT$$TST_BADK (.KEY) THEN RETURN (EDT$_KEYNOTDEF);

!+
! If the key was defined then deallocate memory before cancelling.
!-
    OLD_KEY_PTR = TRN_TBL [.KEY MOD K_KPAD_HASHSIZ];
    KEY_PTR = .OLD_KEY_PTR [KEY_DEF_NEXT];

    IF (.KEY_PTR EQLA 0) THEN RETURN (1);

    WHILE (.KEY_PTR [KEY_DEF_KEY] NEQ .KEY) DO
	BEGIN
	OLD_KEY_PTR = .KEY_PTR;
	KEY_PTR = .KEY_PTR [KEY_DEF_NEXT];

	IF (.KEY_PTR EQLA 0) THEN RETURN (1);

	END;

    OLD_KEY_PTR [KEY_DEF_NEXT] = .KEY_PTR [KEY_DEF_NEXT];
    EDT$$DEA_HEAP (%REF (.KEY_PTR [KEY_DEF_LEN] + KEY_DEF_OVERHEAD), %REF (.KEY_PTR));
    RETURN (1);
    END;					! of routine EDT$$CAN_KDEF

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

ELUDOM