Google
 

Trailing-Edge - PDP-10 Archives - bb-r775d-bm_tops20_ks_upd_4 - sources/chmdelchr.bli
There are 11 other files named chmdelchr.bli in the archive. Click here to see a list.
 %TITLE 'CHMDELCHR - delete characters'
MODULE CHMDELCHR (				! Delete characters
		IDENT = '3-002'			! File: CHMDELCHR.BLI Edit: GB3002
		) =
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 deletes text on the current line (change 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 the routine DELETE_CHARS from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 27-Feb-1981
! 1-003	- Fix module name.  JBS 03-Mar-1981
! 1-004	- Improve some comments.  JBS 02-Jun-1981
! 1-005	- New screen update logic.  JBS 13-Sep-1982
! 1-006	- Change the call to EDT$$MRK_LCNHG.  JBS 27-Dec-1982
! 3-001 - Change CPY_MEM to CPY_STR.  GB 3-Mar-1983
! 3-002 - Add updates from V3 sources.  GB 26-Apr-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$DEL_CHS : NOVALUE;			! Delete part of the current line

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$DEL_CHS  - delete characters'

GLOBAL ROUTINE EDT$$DEL_CHS (			! Delete characters
		FC, 					! Position of first character to delete
		LC					! Position of last character to delete
   	 ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine deletes text on the current line between the
!	two pointers FC and LC.
!
! FORMAL PARAMETERS:
!
!  FC			Position of the first character to delete
!
!  LC			Position of the last character to delete
!
! IMPLICIT INPUTS:
!
!	SEL_POS
!	LN_END
!
! IMPLICIT OUTPUTS:
!
!	SEL_POS
!	LN_PTR
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$MRK_LNCHG : NOVALUE,		! Track line update bounds
	EDT$$UPD_LNLEN : NOVALUE,		! Update the length of the current line
	EDT$$SAV_LN : NOVALUE,			! Save a line in the auxiliary buffer
	EDT$$SEL_RNGPOS;			! Compare the select line with the current line

    EXTERNAL
	SEL_POS,				! select position.
	LN_END,					! End of current line pointer
	LN_PTR,					! Current character pointer
	LN_BUF;					! Line buffer

    LOCAL
	LEN;

!+
! Compute length of the delete, and quit if zero.
!-
    LEN = CH$DIFF (.LC, .FC);
    EDT$$SAV_LN (.FC, .LEN);

    IF (.LEN EQL 0) THEN RETURN;

!+
! Watch out for select range, adjust as necessary.
!-

    IF (EDT$$SEL_RNGPOS () EQL 0)
    THEN
!+
! This is the selected line
!-

	IF CH$PTR_GTR (.SEL_POS, .FC)
	THEN

	    IF CH$PTR_GTR (.SEL_POS, .LC)
	    THEN
		SEL_POS = CH$PLUS (.SEL_POS, -.LEN)
	    ELSE
		SEL_POS = .FC;

!+
! Now, adjust the line.
!-
    EDT$$CPY_STR (CH$DIFF (.LN_END, .LC), .LC, .FC);
    EDT$$UPD_LNLEN (-.LEN);
    EDT$$MRK_LNCHG (SCR_EDIT_MODIFY, CH$DIFF (.FC, CH$PTR (LN_BUF)));
    LN_PTR = .FC;
    END;			! of routine EDT$$DEL_CHS

END				! of Module CHMDELCHR
ELUDOM