Google
 

Trailing-Edge - PDP-10 Archives - bb-r775c-bm_tops20_ks_upd_3 - sources/fputchar.bli
There are 10 other files named fputchar.bli in the archive. Click here to see a list.
 %TITLE 'FPUTCHAR - store a character in the format buffer'
MODULE FPUTCHAR (				! Store a character in the format buffer
		IDENT = '3-002'			! File: FPUTCHAR.BLI Edit: GCJB002
		) =
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:
!
!	Store a character in the format buffer.  Write out the buffer
!	if it overflows.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: March 18, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 19-FEB-1981.  This module was created by
!	extracting routine EDT$$PUT_CH  from module FORMAT.
! 1-002	- Regularize headers.  JBS 05-Mar-1981
! 1-003	- Use EDT$$K_FMT_BUFLEN.  JBS 29-Sep-1982
! 1-004	- Fix a local symbol name.  JBS 04-Jan-1983
! 3-001 - Add updates from V3 source kit.  GB 27-Apr-1983
! 3-002 - Add FMT_FREE to improve speed of format routines. CJG 11-Jan-1984
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$STORE_FMTCH : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$STORE_FMTCH  - store a character in the format buffer'

GLOBAL ROUTINE EDT$$STORE_FMTCH (		! Store a character in the format buffer
	C					! The character to store
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Place a character in the formatted output buffer.  If the pointer is at the
!	end of the buffer then write out the line and start over again.
!
! FORMAL PARAMETERS:
!
!  C			The character to put out.
!
! IMPLICIT INPUTS:
!
!	FMT_BUF
!	FMT_CUR
!	FMT_FREE
!	FMT_LNPOS
!
! IMPLICIT OUTPUTS:
!
!	NONE
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$OUT_FMTBUF;

    EXTERNAL
	FMT_BUF : BLOCK [CH$ALLOCATION (FMT_BUFLEN, BYTE_SIZE)],
					! The formatted output buffer
	FMT_CUR,			! Pointer to next character in above
	FMT_FREE,			! Space left in format buffer
	FMT_LNPOS;			! The current column number

    LOCAL
	SAV_LNPOS;


!+
! Check for end of buffer.
!-

    IF (.FMT_FREE EQL 0)
    THEN
	BEGIN
	SAV_LNPOS = .FMT_LNPOS;
	EDT$$OUT_FMTBUF ();
	FMT_LNPOS = .SAV_LNPOS;
	END;

    CH$WCHAR_A (.C, FMT_CUR);
    FMT_FREE = .FMT_FREE - 1;
    END;


END
ELUDOM