Google
 

Trailing-Edge - PDP-10 Archives - bb-h138e-bm_tops20_v6_1_distr - 6-1-sources/keyputchr.bli
There are 10 other files named keyputchr.bli in the archive. Click here to see a list.
 %TITLE 'KEYPUTCHR - put a character in the command buffer'
MODULE KEYPUTCHR (				! Put a character in the command buffer
		IDENT = '1-004'			! File: KEYPUTCHR.BLI Edit: SMB1004
		) =
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:
!
!	Put a character in the command buffer.
!
! ENVIRONMENT:	Runs at any access mode - AST reentrant
!
! AUTHOR: Bob Kushlis, CREATION DATE: April 7, 1979
!
! MODIFIED BY:
!
! 1-001	- Original.  DJS 24-Feb-1981.  This module was created by
!	extracting routine PUT_COM_CHAR from module KEYTRAN.
! 1-002	- Regularize headers.  JBS 10-Mar-1981
! 1-003	- Use new message codes.  JBS 04-Aug-1981
! 1-004 - Use MSG_BELL for errors.  SMB 30-Jun-1982
!--

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

REQUIRE 'EDTSRC:TRAROUNAM';

FORWARD ROUTINE
    EDT$$PUT_CMDCH : NOVALUE;

!
! INCLUDE FILES:
!

REQUIRE 'EDTSRC:EDTREQ';

!
! MACROS:
!
!	NONE
!
! EQUATED SYMBOLS:
!
!	NONE
!
! OWN STORAGE:
!
!	NONE
!
! EXTERNAL REFERENCES:
!
!	In the routine
%SBTTL 'EDT$$PUT_CMDCH  - put a character in the command buffer'

GLOBAL ROUTINE EDT$$PUT_CMDCH (			! Put a character in the command buffer
	C, 					! Character to put
	FORCE_ECHO				! 1 = echo the character
    ) : NOVALUE =

!++
! FUNCTIONAL DESCRIPTION:
!
!	This routine places a character in the command buffer at CMD_PTR  and
!	advances CMD_PTR .
!
! FORMAL PARAMETERS:
!
!  C			The character to append to the command buffer.
!
!  FORCE_ECHO		If 1, then echo the character.
!
! IMPLICIT INPUTS:
!
!	CMD_BUF
!	CMD_PTR
!	CMD_END
!
! IMPLICIT OUTPUTS:
!
!	CMD_PTR
!
! ROUTINE VALUE:
!
!	NONE
!
! SIDE EFFECTS:
!
!	NONE
!
!--

    BEGIN

    EXTERNAL ROUTINE
	EDT$$MSG_BELL,
	EDT$$TI_ECHOCH;

    EXTERNAL
	CMD_BUF,				! Command buffer
	CMD_PTR,				! Pointer to next char in command buffer
	CMD_END;				! Pointer to end of info in command buffer

    MESSAGES ((COMBUFEXH));
!+
! Check to make sure there is room, if not then put out a message and
! flush the entire buffer.
!-

    IF CH$PTR_EQL (.CMD_PTR, .CMD_END)
    THEN
	BEGIN
	EDT$$MSG_BELL (EDT$_COMBUFEXH);
	CMD_PTR = CH$PTR (CMD_BUF,, BYTE_SIZE);
	END
    ELSE
	BEGIN
!+
! Echo the character if necessary then move it to the buffer.
!-

	IF .FORCE_ECHO THEN EDT$$TI_ECHOCH (.C);

	CH$WCHAR_A (.C, CMD_PTR);
	END;

    END;


END
ELUDOM