Google
 

Trailing-Edge - PDP-10 Archives - BB-H138E-BM - 6-1-sources/wfbottom.bli
There are 10 other files named wfbottom.bli in the archive. Click here to see a list.
 %TITLE 'WFBOTTOM - bottom of buffer'
MODULE WFBOTTOM (				! Move to bottom of current buffer
		IDENT = '3-001'			! File: WFBOTTOM.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:
!
!	Move to the bottom of 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_BOT  from module EDTWF.
! 1-002	- Regularize headers.  JBS 16-Mar-1981
! 1-003	- Abort on control C.  JBS 04-Jan-1982
! 1-004	- Set a flag if control C actually aborts something.  JBS 24-May-1982
! 1-005	- Remove EDT$$SET_WKLN.  JBS 14-Sep-1982
! 1-006 - Check control C about once per second.   SMB 17-Sep-1982
! 1-007 - Go back to checking control C every record. STS 20-Sep-1982
! 1-008	- Keep TBCB_CUR_LIN accurate, for updating the select range.  JBS 28-Dec-198L
! 3-001 - Add updates from V3 sources.  GB 04-May-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$WF_BOT : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$WF_BOT  - move to bottom of buffer'

GLOBAL ROUTINE EDT$$WF_BOT 			! Move to bottom of current buffer
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Move to the bottom of the current buffer.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	CUR_BUF
!	WK_BUK
!
! IMPLICIT OUTPUTS:
!
!	CUR_BUF
!	CC_DONE
!	WK_LN
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$WF_MAKECUR : NOVALUE,
	EDT$$RD_NXTLN,
	EDT$$CHK_CC;			! Check for a control C

    EXTERNAL
	CUR_BUF : REF TBCB_BLOCK,	! Current text buffer control block
	WK_BUK : 			! Pointer to current bucket
	    REF BLOCK [WF_BUKT_SIZE] FIELD (WFB_FIELDS),
	CC_DONE,			! Set to 1 if control C actually aborts something
	WK_LN : REF LIN_BLOCK;		! Pointer to work line

    LOCAL
	CONTROL_C,
	READ_STATUS;

!+
! Just read the last bucket in the buffer, then
! read lines until we can't read any more.
!-
    CUR_BUF [TBCB_CUR_BUKT] = .CUR_BUF [TBCB_LAST_BUKT];
    MOVELINE (CUR_BUF [TBCB_LINE_COUNT], CUR_BUF [TBCB_CUR_LIN]);
    EDT$$WF_MAKECUR (.CUR_BUF [TBCB_CUR_BUKT]);
    CUR_BUF [TBCB_LINE_ADDR] = .WK_BUK [WFB_END];
    CUR_BUF [TBCB_CHAR_POS] = 0;
    WK_LN = .WK_BUK + .CUR_BUF [TBCB_LINE_ADDR];

    DO
	BEGIN
	READ_STATUS = EDT$$RD_NXTLN ();

	IF .READ_STATUS
	THEN
	    BEGIN
	    CONTROL_C = EDT$$CHK_CC ();

	    IF .CONTROL_C THEN CC_DONE = 1;

	    END;

	END
    UNTIL (.CONTROL_C OR ( NOT .READ_STATUS));


    END;					! of routine EDT$$WF_BOT


END
ELUDOM