Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/mcleft.bli
There are 10 other files named mcleft.bli in the archive. Click here to see a list.
 %TITLE 'MCLEFT - move cursor left'
MODULE MCLEFT (				! Move cursor left
		IDENT = '1-002'			! File: MCLEFT.BLI Edit: JBS1002
		) =
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 cursor left.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: September 9, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 19-FEB-1981.  This module was created by
!	extracting routine EDT$$CS_LEFT  from module MOVCUR.
! 1-002	- Regularize headers.  JBS 11-Mar-1981
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$CS_LEFT;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$CS_LEFT  - move cursor left'

GLOBAL ROUTINE EDT$$CS_LEFT 			! Move cursor left
    =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine moves the cursor one character to the left.  If the cursor
!	is on the first character of the line, we move to the previous line
!	(positioning on the line terminator).
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	LN_BUF
!	LN_END
!
! IMPLICIT OUTPUTS:
!
!	LN_PTR
!
! ROUTINE VALUE:
!
!	1 = move successful
!	0 = could not move
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$CS_UP;

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

!+
! Check to see if we are on the first character.
!-

    IF CH$PTR_EQL (.LN_PTR, CH$PTR (LN_BUF,, BYTE_SIZE))
    THEN
	BEGIN
!+
! On the first character.  Try to go up a line and position to the line
! terminator.  If the move up fails, return failure.
!-

	IF (EDT$$CS_UP () EQL 0) THEN RETURN (0);

	LN_PTR = .LN_END;
	END
    ELSE
!+
! Not on the first character, simply move back on character and return
! success.
!-
	LN_PTR = CH$PLUS (.LN_PTR, -1);

    RETURN (1);
    END;


END
ELUDOM