|
|
Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 Intrinsics ReferenceXCONTRAP |
|
Arms or disarms the user written subsystem break trap handling procedure. 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 trap handler can be any procedure in the program or in the libraries to which the program is bound. The [CTRL]Y trap handler has no parameters. The following summarizes subsystem break processing and the intrinsics involved:
See the discussion of enabling/disabling the user written [CTRL]Y trap handler in Trap Handling Programmer's Guide. See also the discussion of FCONTROL(16,17), FCONTROL(41), and RESETCONTROL in this manual. See Chapter 5 “Using Subsystem Break” of this manual for an example illustrating subsystem break processing. |
|