Google
 

Trailing-Edge - PDP-10 Archives - bb-h138e-bm_tops20_v6_1_distr - 6-1-sources/chmdellin.bli
There are 11 other files named chmdellin.bli in the archive. Click here to see a list.
 %TITLE 'CHMDELLIN - delete lines'
MODULE CHMDELLIN (				! Delete lines
		IDENT = '3-001'			! File: CHMDELLIN.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:
!
!	This module deletes lines of text (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 routine was created by
!	extracting the routine DELETE_LINES from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 25-Feb-1981
! 1-003	- Fix module name.  JBS 03-Mar-1981
! 1-004	- Use the ASSERT macro.  JBS 01-Jun-1981
! 1-005	- EDT$$SEL_RNGPOS has 3 values.  JBS 02-Jun-1981
! 1-006	- Put in a check for control C so the 'working' message will flash
!	   during a long CUT command.  JBS 13-Jan-1982
! 1-007	- New screen update logic.  JBS 13-Sep-1982
! 1-008	- Remove the unused reference to EDT$$MRK_LNCHG.  JBS 27-Dec-1982
! 1-009	- Add a parameter to EDT$$COMB_LN.  JBS 28-Dec-1982
!
! 3-001 - Add updates from V3 sources.  GB 26-Apr-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$DEL_TXTLN : NOVALUE;			! Delete whole lines of text

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

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

GLOBAL ROUTINE EDT$$DEL_TXTLN (			! Delete lines
    NUM_LINES, 					! Number of lines to delete
    END_POS					! Place to stop
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine deletes text on NUM_LINES lines starting on the
!	current line at LN_PTR  and going to the END_POS
!	on the last line.
!
! FORMAL PARAMETERS:
!
!  NUM_LINES		Number of lines to delete
!
!  END_POS		Place to stop on last line
!
! IMPLICIT INPUTS:
!
!	LN_PTR
!	SEL_LN
!	LN_BUF
!	LN_END
!	LN_LEN
!	LNO0
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$DEL_CHS : NOVALUE,			! Delete part of the current line
	EDT$$COMB_LN : NOVALUE,			! Combine the current line with the one immediately above it
	EDT$$CS_DWN,				! Move down a line
	EDT$$GET_TXTLN,				! Get current line in line buffer
	EDT$$SAV_LN : NOVALUE,			! Save a line in the auxiliary buffer
	EDT$$SC_DELLN,				! Delete lines from screen
	EDT$$DEL_CURLN,				! Delete a line from buffer
	EDT$$CHK_CC;				! Check for a control C

    EXTERNAL
	LN_BUF,					! Current line buffer
	LN_END,					! End of current line pointer
	LN_LEN,					! Length of current line
	LN_PTR;					! Current character pointer

    LOCAL
	LC;

!+
! Handle the first line.
!-
    LC = .LN_END;

    IF (.NUM_LINES EQL 1) THEN LC = .END_POS;

    EDT$$DEL_CHS (.LN_PTR, .LC);
!+
! Now, if there are more, loop though the middle ones.
!-

    IF (.NUM_LINES GTR 1)
    THEN
	BEGIN
	EDT$$CS_DWN ();

	INCR I FROM 3 TO .NUM_LINES DO
	    BEGIN
!+
! We check for a control C here, not because we wish to terminate
! the process if a control C is typed but only to make sure the
! 'working' message flashes during a long CUT command.
!-
	    EDT$$CHK_CC ();
!+
! Delete the entire line.
!-
	    EDT$$SAV_LN (CH$PTR (LN_BUF, 0, BYTE_SIZE), .LN_LEN);
	    EDT$$DEL_CURLN ();

    	    EDT$$GET_TXTLN ();
	    END;

!+
! Handle the last line.
!-
	EDT$$DEL_CHS (.LN_PTR, .END_POS);
!+
! And combine the various fragments.
!-
	EDT$$COMB_LN (1);
	END;

    END;

END
ELUDOM