Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/chmtadj.bli
There are 11 other files named chmtadj.bli in the archive. Click here to see a list.
 %TITLE 'CHMTADJ - tab adjust'
MODULE CHMTADJ (				! Tab adjust
		IDENT = '1-002'			! File: CHMTADJ.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:
!
!	This module executes the change mode command TADJ.
!
! 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$$TADJ_CMD  from module CHANGE.BLI.
! 1-002	- Regularize headers.  JBS 04-Mar-1981
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$TADJ_CMD : NOVALUE;			! Execute the TADJ command

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$TADJ_CMD  - tab adjust'

GLOBAL ROUTINE EDT$$TADJ_CMD 			! Tab adjust
    : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine executes the TADJ (tabs adjust) command.
!
!		Compute the column of the first non-blank non-tab character.
!		Strip out all leading spaces and tabs.
! 		Insert enough tabs and spaces to bring us to column + TADJ .
!
! FORMAL PARAMETERS:
!
!	NONE
!
! IMPLICIT INPUTS:
!
!	TAB_SIZ
!	TADJ
!	LN_BUF
!	LN_END
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$DEL_CHS : NOVALUE,			! Delete part of the current line
	EDT$$MOV_TOCOL,				! Insert tabs and spaces
	EDT$$FMT_CHWID;				! Compute character size.

    ! Keep track of the bounds within which the current line must be updated

    EXTERNAL
	TAB_SIZ,				! Structured tab size
	TADJ,				! Count for tabs adjust.
	LN_BUF,				! Current line buffer
	LN_END;				! End of current line pointer

    LOCAL
	CP,
	COL;

    LABEL
	BL;

    CP = CH$PTR (LN_BUF,, BYTE_SIZE);
    COL = 0;
BL :
    BEGIN

    WHILE 1 DO
	BEGIN

	IF CH$PTR_EQL (.LN_END, .CP) THEN LEAVE BL;

	SELECTONE CH$RCHAR_A (CP) OF
	    SET

	    [%C' '] :
		COL = .COL + 1;

	    [ASC_K_TAB] :
		COL = .COL + EDT$$FMT_CHWID (ASC_K_TAB, .COL);

	    [OTHERWISE] :
		EXITLOOP;
	    TES;

	END;

    EDT$$DEL_CHS (CH$PTR (LN_BUF,, BYTE_SIZE), CH$PLUS (.CP, -1));
    EDT$$MOV_TOCOL (.COL + .TADJ*.TAB_SIZ);
    END;
    END;


END
ELUDOM