Google
 

Trailing-Edge - PDP-10 Archives - BB-H138F-BM_1988 - 7-sources/chmselpos.bli
There are 11 other files named chmselpos.bli in the archive. Click here to see a list.
 %TITLE 'CHMSELPOS - test position of select range'
MODULE CHMSELPOS (				! Test position of select range
		IDENT = '3-001'			! File: CHMSELPOS.BLI Edit: GB3001
		) =
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:
!
!	This module compares the current line to the select range.
!
! 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 EDT$$SEL_RNGPOS  from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 03-Mar-1981
! 1-003	- Make some minor edits, for esthetics.  JBS 02-Jun-1981
! 1- 004 - Convert to new compare line number macro. STS 20-Oct-1982
! 1-005	- Maintain select information until screen udpate is done with it.  JBS 02-Dec-1982
! 3-001 - Add updates from V3 source kit.  GB 27-Apr-1983
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$SEL_RNGPOS;				! Compare the select line with the current line

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$SEL_RNGPOS  - test position of select range'

GLOBAL ROUTINE EDT$$SEL_RNGPOS 			! Test position of select range
    =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This little routine returns a comparison between the select line
!	and the current line as follows:
!
!		-1  if the select is before the current line or there is no select
!		 0  if it is on the current line
!		 1  if it is after the current line
!
! 	This is useful, because, when text is changed, the select position is
! 	affected only if it is on or after the current line.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	SEL_BUF
!	OLD_SEL
!	SEL_LN
!	CUR_BUF
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	-1  if the select is before the current line or there is no select
!	 0  if the select is on the current line
!	 1  if the select is after the current line
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$CMP_LNO;				! Compare line numbers

    EXTERNAL
	SEL_BUF,				! Pointer to select buffer.
	SEL_LN : LN_BLOCK,		! Relative line number of select.
	CUR_BUF : REF TBCB_BLOCK,	! The current buffer tbcb
	OLD_SEL;			! Pointer to old select buffer

    IF ((.SEL_BUF NEQA .CUR_BUF) AND (.OLD_SEL NEQA .CUR_BUF))
    THEN
	RETURN (-1)				! No select in this buffer
    ELSE
	RETURN (EDT$$CMP_LNO (SEL_LN, CUR_BUF [TBCB_CUR_LIN]));

    END;


END
ELUDOM