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

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Sat Sep 26 18:47:10 EDT 2009


In article <78609629-53f2-4ef7-bbaf-b0181d23f4e5 at y28g2000prd.googlegroups.com>, jbriggs444 <jbriggs444 at gmail.com> writes:
>On Sep 26, 5:21=A0pm, sapienzaf <sapie... at noesys.com> wrote:
>> On Sep 26, 4:35=A0pm, "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=3DT is active to accurately report this.
>>
>> $ WRITE SYS$OUTPUT F$ENVIRONMENT("CONTROL")
>>
>> Although, I'm not sure where it might be hiding in $GETJPI. =A0I suspect
>> $GETDVI is a more likely source. =A0Left as an excercise for the
>> reader. =A0:-)
>
>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.

Yup, it's pretty easy to from the TAST.

It may be in the CTL region of P1 space as well.  I'll take a look for you
tomorrow if I remember.  That's probably easier to get at for you.


-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

  http://www.quirkfactory.com/popart/asskey/eqn2.png
  
  "Well my son, life is like a beanstalk, isn't it?"



More information about the Info-vax mailing list