Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/chminsmod.bli
There are 11 other files named chminsmod.bli in the archive. Click here to see a list.
 %TITLE 'CHMINSMOD - nokeypad insert mode'
MODULE CHMINSMOD (				! Nokeypad insert mode
		IDENT = '3-002'			! File: CHMINSMOD.BLI Edit: CJG3002
		) =
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 implements nokeypad insert mode.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: Unknown
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 04-Feb-1981.  This module was created by
!	extracting routine INSERT_MODE from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 03-Mar-1981
! 1-003	- Add return values.  JBS 02-Oct-1981
! 1-004	- Don't allow a bare ESC to terminate a multi-line insert.  JBS 17-Aug-1982
! 1-005 - Set the message flag so "I" stays on screen.  SMB 17-Aug-1982
! 1-006	- New screen update logic.  JBS 13-Sep-1982
! 1-007	- Change the call to screen update and add a LOAD entry point, so this module
!	   can be displaced by the screen update modules on the PDP-11.  JBS 25-Sep-1982
! 1-008	- Change the screen update call again, to reduce the overlay size on the PDP-11.  JBS 27-Sep-1982
! 1-009	- Add a parameter to EDT$$COMB_LN.  JBS 28-Dec-1982
! 3-001 - Add updates from V3 source kit.  GB 27-Apr-1983
! 3-002 - Fix nokeypad mode insert. CJG 6-Oct-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$INS_MOD;				! Process no-keypad insertion

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$INS_MOD  - nokeypad insert mode'

GLOBAL ROUTINE EDT$$INS_MOD 			! Nokeypad insert mode
    =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine implements the no-keypad insert mode.  Process insertions
!	and the delete character until a CTRL/Z is seen, then return.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	KPAD
!	TI_TYP
!	LN_BUF
!	LN_PTR
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	1 = ok, 0 = end of journal file
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$DEL_CHS : NOVALUE,		! Delete part of the current line
	EDT$$INS_CHS,			! Insert a string of characters which may include carriage returns
	EDT$$COMB_LN : NOVALUE,		! Combine the current line with the one immediately above it
	EDT$$SC_UPD,			! Update the screen
	EDT$$STOP_WKINGMSG,		! Terminate working AST
	EDT$$TI_INPCH;			! Get a character of input

    EXTERNAL
	MSGFLG,				! Text to stay on screen
	KPAD,				! Keypad activated?
	TI_TYP,				! Terminal type.
	LN_BUF,				! Current line buffer
	LN_PTR;				! Current character pointer

    LOCAL
	C;

    IF ((.KPAD NEQ 0) OR (.TI_TYP EQL TERM_HCPY)) THEN RETURN (1);

    EDT$$STOP_WKINGMSG ();

    MSGFLG = 1;

    WHILE 1 DO
	BEGIN
	EDT$$SC_UPD ();

	IF (EDT$$TI_INPCH (C) EQL 0) THEN RETURN (0);

	IF (.C EQL ASC_K_CTRL_Z) THEN EXITLOOP;

	IF (.C EQL ASC_K_DEL)
	THEN

	    IF CH$PTR_EQL (.LN_PTR, CH$PTR (LN_BUF,, BYTE_SIZE))
	    THEN
		EDT$$COMB_LN (1)
	    ELSE
		EDT$$DEL_CHS (CH$PLUS (.LN_PTR, -1), .LN_PTR)

	ELSE
	    BEGIN
	    CH$WCHAR (.C, CH$PTR (C,, BYTE_SIZE));
	    EDT$$INS_CHS (CH$PTR (C,, BYTE_SIZE), 1);
	    END

	END;

    MSGFLG = 0;

    RETURN (1);
    END;


END
ELUDOM