Google
 

Trailing-Edge - PDP-10 Archives - BB-R775C-BM - sources/scrnewdel.bli
There are 10 other files named scrnewdel.bli in the archive. Click here to see a list.
 %TITLE 'SCRNEWDEL - delete a line from the screen'
MODULE SCRNEWDEL (				! delete a line from the screen
		IDENT = '1-005'			! File: SCRNEWDEL.BLI Edit: JBS1005
		) =
BEGIN
!
!			  COPYRIGHT (c) 1981, 1985 B:
!	      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 updates the screen information data structure to
!	reflect the deletion of a line.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Sharon M. Burlingame, CREATION DATE: September 15, 1982
!
! MODIFIED BY:
!
! 1-001	- Original.  SMB 15-Sep-1982.
! 1-002 - Fix up the original to conform to new design.  SMB 10-Oct-1982
! 1-003 - Add more code to remove existing bugs.  SMB 26-Oct-1982
! 1-004	- Change updating of the screen pointers.  JBS 29-Oct-1982
! 1-005	- Don't set the rebuild flag.  JBS 03-Jan-1983
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SC_LNDEL : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SC_LNDEL  - delete a line from the screen'

GLOBAL ROUTINE EDT$$SC_LNDEL (			! Delete a line from the screen
    SCRPTR					! Screen pointer to delete
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Update the screen line information structure by
!	releasing the memory to the pool of available storage.
!	Update various screen line pointers as necessary.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	MEM_CNT
!	BOT_SCRPTR
!	EOB_SCRPTR
!	TOP_SCRPTR
!	FST_AVLN
!	FST_SCRPTR
!	LST_SCRPTR
!	CSR_SCRPTR
!	CUR_SCRLN
!
! IMPLICIT OUTPUTS:
!
!	MEM_CNT
!	BOT_SCRPTR
!	EOB_SCRPTR
!	TOP_SCRPTR
!	FST_AVLN
!	FST_SCRPTR
!	LST_SCRPTR
!	CSR_SCRPTR
!	CUR_SCRLN
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL
	MEM_CNT,				! Allocated memory count
	BOT_SCRPTR : REF SCREEN_LINE,		! Bottom screen pointer
	EOB_SCRPTR : REF SCREEN_LINE,		! EOB screen pointer
	TOP_SCRPTR : REF SCREEN_LINE,		! Top screen pointer
	FST_AVLN : REF SCREEN_LINE,		! First available screen info memory
	FST_SCRPTR : REF SCREEN_LINE,		! Pointer to first screen line info
	LST_SCRPTR : REF SCREEN_LINE;		! Pointer to last screen line info

    MAP
	SCRPTR : REF SCREEN_LINE;		! Screen pointer parameter

    LOCAL
	NXT_ADDR : REF SCREEN_LINE,		! Address of next line info
	PREV_ADDR : REF SCREEN_LINE;		! Address of previous line info

!+
! Find the next and previous pointers of the line being deleted.
!-
    NXT_ADDR = .SCRPTR [SCR_NXT_LINE];
    PREV_ADDR = .SCRPTR [SCR_PRV_LINE];
!+
! Check for deleting the first line of the screen data base.
!-

    IF (.FST_SCRPTR EQLA .SCRPTR)
    THEN
	BEGIN
	FST_SCRPTR = .NXT_ADDR;
	FST_SCRPTR [SCR_PRV_LINE] = 0;
	END;

!+
! Check for deleting the last line of the screen data base.
!-

    IF (.SCRPTR EQLA .LST_SCRPTR)
    THEN
	BEGIN
	LST_SCRPTR = .PREV_ADDR;
	LST_SCRPTR [SCR_NXT_LINE] = 0;
	END;

!+
! Check for EOB deleted off the screen
!-

    IF (.EOB_SCRPTR EQLA .SCRPTR) THEN EOB_SCRPTR = 0;

!+
! Check for deleting the top line from the data base.
!-

    IF (.TOP_SCRPTR EQLA .SCRPTR) THEN TOP_SCRPTR = 0;

!+
! Check for deleting the bottom line from the data base.
!-

    IF (.BOT_SCRPTR EQLA .SCRPTR) THEN BOT_SCRPTR = 0;

!+
! Fix up the previous and next pointers.
!-

    IF (.PREV_ADDR NEQA 0) THEN PREV_ADDR [SCR_NXT_LINE] = .NXT_ADDR;

    IF (.NXT_ADDR NEQA 0) THEN NXT_ADDR [SCR_PRV_LINE] = .PREV_ADDR;

!+
! The line being deleted is indicated by SCRPTR.  If there
! are no screen line buffers in the free list, then start
! a new list; otherwise add the memory to the front of the current list.
!-
    SCRPTR [SCR_NXT_LINE] = .FST_AVLN;
    SCRPTR [SCR_PRV_LINE] = -1;			! For debugging
    FST_AVLN = .SCRPTR;
    MEM_CNT = .MEM_CNT - 1;

    END;					! of routine EDT$$SC_INSLN

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

ELUDOM