Google
 

Trailing-Edge - PDP-10 Archives - BB-H138F-BM_1988 - 7-sources/wfclear.bli
There are 10 other files named wfclear.bli in the archive. Click here to see a list.
 %TITLE 'WFCLEAR - empty the current buffer'
MODULE WFCLEAR (				! Empty the current buffer
		IDENT = '1-002'			! File: WFCLEAR.BLI Edit: JBS1002
		) =
BEGIN
!COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1981, 1988.  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 THAT IS NOT SUPPLIED BY DIGITAL.
!
!
!++
! FACILITY:	EDT -- The DEC Standard Editor
!
! ABSTRACT:
!
!	Empty the current buffer.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: October 16, 1978
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 23-Feb-1981.  This module was created by
!	extracting routine EDT$$WF_CLRBUF  from module EDTWF.
! 1-002	- Regularize headers.  JBS 16-Mar-1981
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$WF_CLRBUF : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$WF_CLRBUF  - empty the current buffer'

GLOBAL ROUTINE EDT$$WF_CLRBUF 			! Empty the current buffer
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Clear the entire current buffer.  The first bucket of the buffer is
!	updated to be empty, and, if there is more than one, the rest of the
!	bucket is placed on the available bucket list.  Note that since the
!	buckets are already linked together, we need only link the last bucket
!	in the buffer to the current available bucket, then make avail the
!	first bucket we are releasing.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	CUR_BUF
!	WK_AVAIL
!	WK_BUK
!	WK_CURBUK
!	LNO_ZERO
!
! IMPLICIT OUTPUTS:
!
!	WK_AVAIL
!	WK_BUK
!	CUR_BUF
!	WK_MODFD
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$WF_BOT : NOVALUE,
	EDT$$TOP_BUF : NOVALUE;

    EXTERNAL
	CUR_BUF : REF TBCB_BLOCK,	! Current text buffer control block
	WK_AVAIL,			! Pointer to next available deleted bucket
	WK_BUK : 			! Pointer to current bucket
	    REF BLOCK [WF_BUKT_SIZE] FIELD (WFB_FIELDS),
	WK_CURBUK,			! Number of the current bucket
	WK_MODFD,			! Flag indicating bucket was modified
	LNO_ZERO : LN_BLOCK;

    EDT$$TOP_BUF ();
!+
! Release remaining buckets if there are more than one.
!-

    IF (.WK_BUK [WFB_NEXT_BUKT] NEQ 0)
    THEN
	BEGIN
	EDT$$WF_BOT ();
	WK_BUK [WFB_NEXT_BUKT] = .WK_AVAIL;
	WK_MODFD = 1;
	EDT$$TOP_BUF ();
	WK_AVAIL = .WK_BUK [WFB_NEXT_BUKT];
	END;

    CUR_BUF [TBCB_LINE_ADDR] = WFB_FIXED_SIZE;
    WK_BUK [WFB_END] = WFB_FIXED_SIZE;
    WK_BUK [WFB_NEXT_BUKT] = 0;
    WK_MODFD = 1;
    MOVELINE (LNO_ZERO, CUR_BUF [TBCB_LINE_COUNT]);
    CUR_BUF [TBCB_CHAR_COUNT] = 0;
    CUR_BUF [TBCB_LAST_BUKT] = .WK_CURBUK;
    END;


END
ELUDOM