GDSX Manual

User Exit Descriptions
Extended General Device Support (GDSX) Manual134303
9-23
USER^STOP
USER^STOP allows you to handle housekeeping for associated files before TSCODE
closes them.
tcb input
INT .EXT:ref
is a pointer to the TCB for the task being stopped.
Considerations
If your GDSX process is configured with a LINE, the USER^STOP procedure must
be able to handle the termination of the LINE and the SUs under the LINE. This
coding usually requires scanning all DCBs corresponding to a LINE, which can be
accomplished by means of the BIT^TEST procedure and two bit maps maintained in
the LCB for each active or configured LINE. See AMAP and CMAP in the
line^template STRUCT in Appendix C.
The CMAP array defines those SUs (DCBs) that are configured under this LINE.
The AMAP array defines those SUs under this LINE that are currently active. These
two maps are bit arrays, with bit[i] corresponding to the ith DCB, addressed by
DCBTBL[i]. See Section 5 for a discussion of Device Control Blocks.
The BIT^TEST function is evaluated for a LINE’s CMAP array by:
BIT^TEST(CMAP, n)
This returns true if the nth bit is on, meaning that DCBTBL[n] is configured.
The BIT^TEST function is evaluated for a LINE’s AMAP array by:
BIT^TEST(AMAP, n)
This returns true if the nth bit is on, meaning that DCBTBL[n] is active.
The following example scans all terminals configured on LINE X:
INT .EXT DCB(USER^DCB^DEF); ! USER^DCB^DEF is the
! same as the DCB^TEMPLATE
! with possible user
! extensions. See ULHDECS.
INT X;
INT .CUR^LINE(LINE) := @LINETBL[X]; ! LINETBL is a
! GDSX global.
USE DEV; DEV := 0;
! MAXTERMS is a global configuration parameter
WHILE (DEV := DEV + 1) <= MAXTERMS DO
IF BIT^TEST (CUR^LINE.CMAP, DEV) THEN
BEGIN
@DCB := DCBTBL[DEV]; ! Configured device
PROC USER^STOP ( tcb ); !
i