" Module: VMSTERMINAL.ST Author: A. Grant Date: 4-May-1991 Version: 1.00-00 Modified: 4-May-1991 This module provides the basic IO to a terminal using VMS $QIO's. By default, the terminal is NOECHO. " Object subclass: #VMSTerminal instanceVariableNames: 'dcb' classVariableNames: '' poolDictionaries: '' category: 'VMS'. ! !VMSTerminal class methodsFor: 'creation'! new: aString size: anInteger "Create a new instance of a Terminal Device on aString with read buffer size of anInteger." | newTerminal | newTerminal := super new. newTerminal open: aString bufSize: anInteger. ^newTerminal !! !VMSTerminal methodsFor: 'private'! open: aString bufSize: anInteger dcb := self open: aString size: anInteger. ^self !! !VMSTerminal methodsFor: 'Access'! initRead ^self initRead: dcb ! read ^self getRead: dcb terminate: 0 ! pollRead ^self poll: dcb ! readAndTerminate ^self getRead: dcb terminate: 1 ! write: aString self write: dcb string: aString. ^self ! put: aCharacter self put: dcb char: aCharacter. ^self !! | dynfun | dynfun := VmsDynamicFunction new. dynfun addLibrary: 'AKG_DTSTSHR'. dynfun defineExternFunc: 'dt_init' withSelectorArgs: 'open: aString size: anInteger' forClass: VMSTerminal returning: #int args: #(string int). dynfun defineExternFunc: 'dt_write' withSelectorArgs: 'write: anInteger string: aString' forClass: VMSTerminal returning: #int args: #(int string). dynfun defineExternFunc: 'dt_put' withSelectorArgs: 'put: anInteger char: aCharacter' forClass: VMSTerminal returning: #int args: #(int char). dynfun defineExternFunc: 'dt_init_read' withSelectorArgs: 'initRead: anInteger' forClass: VMSTerminal returning: #int args: #(int). dynfun defineExternFunc: 'dt_get_read' withSelectorArgs: 'getRead: anInteger terminate: anInteger' forClass: VMSTerminal returning: #string args: #(int int). dynfun defineExternFunc: 'dt_poll_read' withSelectorArgs: 'poll: anInteger' forClass: VMSTerminal returning: #int args: #(int). dynfun addLibrary: 'VAXCRTL'. dynfun defineExternFunc: 'sleep' withSelectorArgs: 'sleep: anInteger' forClass: VMSTerminal returning: #void args: #(int). !