tldm-universe/Ardent/UV/APP.PROGS/PTERM
2024-09-09 17:51:08 -04:00

132 lines
4.6 KiB
Plaintext
Executable File

*******************************************************************************
*
* Support of PR1ME INFORMATION subroutine '!PTERM'
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/13/98 23801 RGA Change copyright info.
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
$OPTIONS DEFAULT
SUBROUTINE PR1ME( OPTIONS )
*************************************************************************
*
* Emulate the PTERM command by performing an "EXECUTE PTERM { options }"
*
* Valid options include:
*
* BREAK ON - enable terminal BREAK key
* BREAK OFF - disable terminal BREAK key
* ERASE char - sets "char" as the backspace key
* KILL char - sets "char" as the delete-line key
* HALF LF - sets terminal to half-duplex;
* carriage return automatically generates
* linefeed
* HALF NOLF - sets terminal to half-duplex;
* carriage return does not generate linefeed
* FULL LF - sets terminal to full-duplex;
* carriage return automatically generates
* linefeed
* FULL NOLF - sets terminal to full-duplex;
* carriage return does not generate linefeed
* NOXOFF - disables flow control (XON/XOFF)
* XOFF - enables flow control (XON/XOFF)
* XON - enables flow control (XON/XOFF)
*
*************************************************************************
*
EQU TRUE TO 1, FALSE TO 0
NEW.OPTIONS = ""
OPTIONS = TRIM( OPTIONS )
OPTIONS := " "
*
GOSUB 100 ;* Parse "OPTIONS"; build "NEW.OPTIONS"
SENTENCE = "PTERM ":TRIM( NEW.OPTIONS )
EXECUTE SENTENCE
RETURN
STOP
*
*
*
*
100
* Parse the "OPTIONS" string, yielding "NEW.OPTIONS"
*
ERASE.KILL.FLAG = FALSE ;* Was last token "ERASE" or "KILL" ?
I = 1
LOOP
TOKEN = FIELD( OPTIONS, " ", I )
WHILE TOKEN DO
IF TOKEN[ 1, 1 ] = "-" THEN TOKEN = TOKEN[ 2, LEN( TOKEN )]
IF ERASE.KILL.FLAG THEN
NEW.OPTIONS := " ":TOKEN
ERASE.KILL.FLAG = FALSE
END ELSE
BEGIN CASE
CASE TOKEN[ 1, 1 ] = "B"
NEW.OPTIONS := " BREAK"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 1 ] = "D"
NEW.OPTIONS := " DELAY"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 2 ] = "EC"
NEW.OPTIONS := " ECHO"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 2 ] = "ER"
NEW.OPTIONS := " ERASE"
ERASE.KILL.FLAG = TRUE
CASE TOKEN[ 1, 1 ] = "F"
NEW.OPTIONS := " FULL"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 1 ] = "H"
NEW.OPTIONS := " HALF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 1 ] = "K"
NEW.OPTIONS := " KILL"
ERASE.KILL.FLAG = TRUE
CASE TOKEN[ 1, 1 ] = "L"
NEW.OPTIONS := " LF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 3 ] = "NOD"
NEW.OPTIONS := " NODELAY"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 3 ] = "NOL"
NEW.OPTIONS := " NOLF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 3 ] = "NOX"
NEW.OPTIONS := " NOXOFF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 2 ] = "OF"
NEW.OPTIONS := " OFF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 3 ] = "XOF"
NEW.OPTIONS := " XOFF"
ERASE.KILL.FLAG = FALSE
CASE TOKEN[ 1, 3 ] = "XON"
NEW.OPTIONS := " XOFF"
ERASE.KILL.FLAG = FALSE
CASE 1
NEW.OPTIONS := " ":TOKEN
ERASE.KILL.FLAG = FALSE
END CASE
END
I += 1
REPEAT
RETURN
END