Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/ldefk.bli
There are 10 other files named ldefk.bli in the archive. Click here to see a list.
 %TITLE 'LDEFK - DEFINE KEY command'
MODULE LDEFK (				! DEFINE KEY line-mode command
		IDENT = '1-006'			! File: LDEFK.BLI Edit: JBS1006
		) =
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 executes the line mode DEFINE KEY command.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: February 3, 1978
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 30-JAN-81.  This module was created by
!	extracting the routine DEFINE_COM from the module EXEC.BLI.
! 1-002	- Regularize headers.  JBS 19-Mar-1981
! 1-003	- Change SY_EXIT to EDT$$SYS_EXI .  JBS 31-Mar-1981
! 1-004	- Use new message codes.  JBS 05-Aug-1981
! 1-005	- Remove INP_FILE.  JBS 16-Aug-1981
! 1-006	- EDT$DEFK returns a status.  JBS 18-May-1982
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$DEFK_CMD : NOVALUE;			! Process the DEFINE KEY command

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$DEFK_CMD  - DEFINE KEY command'

GLOBAL ROUTINE EDT$$DEFK_CMD 			! DEFINE KEY line-mode command
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Command processing for DEFINE KEY.   Simply call the define key routine for change mode,
!	and display an error message if it fails.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	INP_SRC
!	RCOV_MOD
!	EXE_CURCMD
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	If the attempt to define the key fails, may never
!	return to the caller.
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$TST_BADK,
	EDT$$DEFK,
	EDT$$FMT_MSG,
	EDT$$SYS_EXI : NOVALUE;

    EXTERNAL
	INP_SRC,
	RCOV_MOD,
	EXE_CURCMD : REF NODE_BLOCK;	! Pointer to the current command.

    LOCAL
	STATUS;

    MESSAGES ((KEYNOTDEF, EDITORABO));

    IF EDT$$TST_BADK (.EXE_CURCMD [KEY_VAL])
    THEN
	EDT$$FMT_MSG (EDT$_KEYNOTDEF)
    ELSE
	BEGIN
	STATUS = EDT$$DEFK (.EXE_CURCMD [KEY_VAL], .EXE_CURCMD [AS_STR],
	    .EXE_CURCMD [AS_LEN]);

	IF ( NOT .STATUS)
	THEN
	    BEGIN
	    EDT$$FMT_MSG (.STATUS);
!+
! If we run out of memory when defining keys in the startup file, abort the editor.
!-

	    IF (.INP_SRC EQL INP_COMMAND) THEN EDT$$SYS_EXI (EDT$_EDITORABO);

	    END;

	END;

    END;					! of routine EDT$$DEFK_CMD


END
ELUDOM