Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

282 Chapter9
Intrinsics Reference (cont)
XCONTRAP
XCONTRAP
Arms or disarms the user written subsystem break trap handling
procedure.
Syntax
I32V I32
XCONTRAP(plabel,oldplabel);
Use
The XCONTRAP intrinsic arms or disarms the user-written subsystem
break (
[CTRL]Y) trap handling procedure.
When a session is initiated, the user written
[CTRL]Y trap handler is
disarmed. If you are running a program in an interactive session, you
can arm a special trap that transfers control in the program to a trap
handling procedure whenever a subsystem break signal is entered from
the session terminal. (This is called the
[CTRL]Y trap since [CTRL]Y is
the default subsystem break character.)
The subsystem break signal is normally transmitted by pressing
[CTRL]Y. In transparent editing mode, you are allowed to define a
different character to be used to invoke subsystem break by specifying
the new character as part of param in a call to FCONTROL(41).
You can also use FDEVICECONTROL to alter the subsystem break
character in either standard or transparent mode. See the discussion of
the FDEVICECONTROL intrinsic earlier in this chapter for the proper
parameter settings to use for this purpose.
If enabled, subsystem break allows the terminal user to stop a
“program local” or “subsystem local” command. Before subsystem break
can be enabled, however, you must call XCONTRAP, specifying the
external label of a user written procedure which contains the steps that
will be taken if subsystem break is entered during execution of your
program as the value of plabel.
If it is desirable for your program to do so, subsystem break can be
temporarily disabled through a call to FCONTROL(16). It can then be
reenabled through a call to FCONTROL(17).
Only one process in a session can receive a
[CTRL]Y trap at any one
time. The process that called XCONTRAP most recently receives the
next
[CTRL]Y trap. Once a process has received a [CTRL]Y trap, it cannot
receive another until it calls the RESETCONTROL intrinsic. Only
processes running in a session (not in a job) can arm
[CTRL]Y traps. The