Trailing-Edge
-
PDP-10 Archives
-
BB-AE97C-BM
-
sources/mcgetlin.bli
There are 10 other files named mcgetlin.bli in the archive. Click here to see a list.
%TITLE 'MCGETLIN - get a text line'
MODULE MCGETLIN ( ! Get a text line
IDENT = '3-001' ! File: MCGETLIN.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:
!
! Get a text line.
!
! 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$$GET_TXTLN from module MOVCUR.
! 1-002 - Regularize headers. JBS 11-Mar-1981
! 1-003 - Put edt$$tst_eob in line. STS 22-Sep-1982
! 3-001 - Add updates from V3 sources. GB 03-May-1983
!--
%SBTTL 'Declarations'
!
! TABLE OF CONTENTS:
!
REQUIRE 'EDTSRC:TRAROUNAM';
FORWARD ROUTINE
EDT$$GET_TXTLN : NOVALUE;
!
! INCLUDE FILES:
!
REQUIRE 'EDTSRC:EDTREQ';
!
! MACROS:
!
! NONE
!
! EQUATED SYMBOLS:
!
! NONE
!
! OWN STORAGE:
!
! NONE
!
! EXTERNAL REFERENCES:
!
! In the routine
%SBTTL 'EDT$$GET_TXTLN - get a text line'
GLOBAL ROUTINE EDT$$GET_TXTLN ! Get a text line
: NOVALUE =
!++
! FUNCTIONAL DESCRIPTION:
!
! This routine fectches the current line from the work file into the
! current line buffer. The pointer LN_PTR is updated to
! point to the cursor position and LN_END and LN_LEN
! are intitialized. A carriage return character is placed after the
! last character in the buffer to facilitate search operations.
!
! FORMAL PARAMETERS:
!
! NONE
!
! IMPLICIT INPUTS:
!
! CUR_BUF
! LN_BUF
! WK_LN
!
! IMPLICIT OUTPUTS:
!
! LN_CHGD
! LN_PTR
! LN_END
! LN_LEN
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS:
!
! NONE
!
!--
BEGIN
EXTERNAL ROUTINE
EDT$$RD_CURLN;
EXTERNAL
LN_CHGD, ! Indicates current line has changed.
CUR_BUF : REF TBCB_BLOCK, ! Current text buffer
LN_BUF, ! Current line buffer.
LN_PTR, ! Current character pointer.
LN_END, ! End of current line pointer.
LN_LEN, ! Length of current line.
EOB_LN,
WK_LN : REF LIN_BLOCK; ! Current line pointer.
!+
! Make sure the current line is accessable.
!-
EDT$$RD_CURLN ();
!+
! Check for end of buffer.
!-
IF (.WK_LN EQLA EOB_LN)
THEN
LN_LEN = 0
ELSE
BEGIN
!+
! Get the length and move that many characters.
!-
LN_LEN = .WK_LN [LIN_LENGTH];
CH$MOVE (.LN_LEN, CH$PTR (WK_LN [LIN_TEXT], 0, BYTE_SIZE),
CH$PTR (LN_BUF, 0, BYTE_SIZE));
END;
!+
! Set up the end of line pointer.
!-
LN_END = CH$PTR (LN_BUF, .LN_LEN, BYTE_SIZE);
!+
! Place a CR at the end of the line.
!-
CH$WCHAR (ASC_K_CR, .LN_END);
!+
! Set up the cursor pointer to point to the current character.
!-
LN_PTR = CH$PTR (LN_BUF, .CUR_BUF [TBCB_CHAR_POS], BYTE_SIZE);
!+
! And mark the current line as unchanged.
!-
LN_CHGD = 0;
END;
END
ELUDOM