Google
 

Trailing-Edge - PDP-10 Archives - BB-R775C-BM - sources/chmgdir.bli
There are 11 other files named chmgdir.bli in the archive. Click here to see a list.
 %TITLE 'CHMGDIR - look for a direction indicator'
MODULE CHMGDIR (				! Look for a direction indicator
		IDENT = '1-005'			! File: CHMGDIR.BLI Edit: JBS1005
		) =
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:
!
!	This module looks for an explicit direction indicator.
!
! 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$$CHK_DIR  from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 02-Mar-1981
! 1-003	- Correct the file name.  JBS 11-Mar-1981
! 1-004 - Add a return value to flag direction setting.  SMB 22-Oct-1981
! 1-005	- Remove leading blank line--it confused EDIT11, thus not converting
!	   the module name to PDP-11 format.  JBS 27-Oct-1981
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$CHK_DIR;				! Determine the current direction

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$CHK_DIR  - look for a direction indicator'

GLOBAL ROUTINE EDT$$CHK_DIR 			! Look for a direction indicator
    =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This little routine looks for an explicit direction indicator (+ or -) and sets
!	DIRN  accordingly.  If no direction is seen, DIRN
!	is left unchanged.
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	CMD_PTR
!
! IMPLICIT OUTPUTS:
!
!	DIRN
!
! ROUTINE VALUE:
!
!	0 - direction forward or explicitly set backward (with '-')
!	1 - direction backward but not set explicitly
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL
	DIRN,				! The current direction.
	CMD_PTR;				! Command string pointer

    IF (CH$RCHAR (.CMD_PTR) EQL %C'-')
    THEN
	DIRN = DIR_BACKWARD
    ELSE

	IF (CH$RCHAR (.CMD_PTR) EQL %C'+')
	THEN
	    DIRN = DIR_FORWARD
	ELSE
!+
! Special handling for cases where we want a count which is not preceded by a
! '+' or '-' to be flagged as '+' rather than being left unchanged.
!-

	    IF (.DIRN EQL DIR_BACKWARD) THEN RETURN (1) ELSE RETURN (0);

    CMD_PTR = CH$PLUS (.CMD_PTR, 1);
    RETURN (0);
    END;


END
ELUDOM