[Info-vax] Getting state of Control-T from a C program.

jbriggs444 jbriggs444 at gmail.com
Sat Sep 26 17:38:07 EDT 2009


On Sep 26, 5:21 pm, sapienzaf <sapie... at noesys.com> wrote:
> On Sep 26, 4:35 pm, "John E. Malmberg" <wb8... at qsl.network> wrote:
>
> > I have not been able to find a SYS$GETJPI or terminal sense mode to
> > obtain if the DCL SET CONTROL=T is active to accurately report this.
>
> $ WRITE SYS$OUTPUT F$ENVIRONMENT("CONTROL")
>
> Although, I'm not sure where it might be hiding in $GETJPI.  I suspect
> $GETDVI is a more likely source.  Left as an excercise for the
> reader.  :-)

At a guess, DCL has set up an attention AST.  The terminal driver
knows this.  $GETDVI does not.

"5.2.6 Out-of-Band Control Character Handling
All control characters (0 through 1F hexadecimal) can be enabled as
out-of-band characters. Typing one of these characters immediately
delivers an AST to the requesting process. DCL uses this mechanism to
sense whether Ctrl/T has been entered. Out-of-band character options
allow using the IO$M_INCLUDE function modifier to include the
character in the data stream and the IO$M_TT_ABORT function modifier
to abort the current input or output operation."

"5.4.3.5 Enable Out-of-Band AST Function Modifier
The enable out-of-band AST function modifier requests that the
terminal driver queue an AST for the requesting process when you enter
any one of 32 control characters. The following combinations of
function code and modifier are provided:

IO$_SETMODE!IO$M_OUTBAND---Enable out-of-band AST
IO$_SETCHAR!IO$M_OUTBAND---Enable out-of-band AST
These function code modifier pairs take the following device- or
function-dependent arguments:

P1---Address of the AST service or 0 if the AST entered on this
channel is to be canceled. (The AST parameter will be the out-of-band
character.)
P2---Address of a character mask with the same format as the short
form terminator mask (see Section 5.4.1.2).
P3---Access mode to deliver AST (maximized with the caller's access
mode).
The IO$_SETMODE!IO$M_OUTBAND function can optionally take the
following function modifiers:

IO$M_INCLUDE---Include the character typed in the data stream.
IO$M_TT_ABORT---Allow current read and write operations to be aborted.
(The IOSB for aborted operations returns the status SS$_CONTROLC.)


So if you know where to look you can presumably find a chain of out-of-
band AST's queued on the UCB and if one of them has T in the mask and
points to the DCL routine for processing a control-T out of band AST
then you know that control-T is enabled.

Far easier to query DCL directly with F$ENVIRONMENT.




More information about the Info-vax mailing list