ZU ;SF/JLI,RWF - For DSM, TIE ALL TERMINALS TO THIS ROUTINE!! ;07/09/2001 13:31
;;8.0;KERNEL;**13,24,84,94,118,162,225**;Jul 10, 1995
;FOR VAX-DSM V5 & V6
EN ;See that escape processing is off, Conflict with Screenman
S X=$&ZLIB.%DISABLCTRL($C(25)) U $I:(NOCENABLE:NOESCAPE)
D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGIN$")
S (ZUGUI1,ZUGUI2)="" ;$&ZLIB.%TRNLNM("DECW$DISPLAY",,,,,"VALUE")
N $ESTACK,$ETRAP S $ETRAP="S %ZTER11S=$STACK D ERR^ZU Q:$QUIT 0 Q"
;Only call ShareLic for Telnet connections.
D:$I["_TNA" SHARELIC^%ZOSV(0)
G ^XUS
;
G ;Entry point for GUI device.
Q ;S ZUGUI1=1 G EN
ERR ;Come here on error
I $ZE["STKOVR" S $ET="Q:$ST>"_($ST-8)_" D ERR2^ZU" Q
ERR2 S $ETRAP="D UNWIND^ZU" L U $I:NOCENABLE
Q:$ECODE["<PROG>"
I $ZE["^XUS1A:2, %DSM-E-WRITERR" G HALT
I $G(IO)]"",$D(IO(1,IO)),$E($G(IOST))="P" U IO W @$S($D(IOF):IOF,1:"#")
I $G(IO(0))]"" U IO(0) W !!,"RECORDING THAT AN ERROR OCCURRED ---",!!?15,"Sorry 'bout that",!,*7,!?10,"$STACK=",$STACK," $ECODE=",$ECODE,!?10,"$ZERROR=",$ZERROR
D ^%ZTER K %ZT S XUERF="" ; Capture symbol table first!
I $D(%ZTERROR),$P(%ZTERROR,"^",2)="F" H ; Halt immediately for disaster type FATAL errors
;U $I:NOCENABLE D PROGMODE^%ZOSV I Y U $I:CENABLE Q
I $G(DUZ)'>0 HALT
;
CTRLC I $D(IO)=11 U IO(0) C:IO'=IO(0) IO S IO=IO(0)
W:$ZE["-CTLC" !,"--Interrupt Acknowledged",!
D KILL1^XUSCLEAN ;Clean up symbol table
S $ECODE=",<<POP>>,"
Q
;
UNWIND ;Unwind the stack
Q:$ESTACK>1 G CONT:$ECODE["<<HALT>>",CTRLC2:$ECODE["<<POP>>"
S $ECODE=""
Q
;
CTRLC2 S $ECODE="" G:$G(^XUTL("XQ",$J,"T"))<2 ^XUSCLEAN
S ^XUTL("XQ",$J,"T")=1,XQY=$G(^(1)),XQY0=$P(XQY,"^",2,99)
G:$P(XQY0,"^",4)'="M" CTRLC2
S XQPSM=$P(XQY,"^",1),XQY=+XQPSM,XQPSM=$P(XQPSM,XQY,2,3)
G:'XQY ^XUSCLEAN
S $ECODE="",$ETRAP="S %ZTER11S=$STACK D ERR^ZU Q:$QUIT 0 Q"
U $I:NOESCAPE G M1^XQ
;
HALT I $D(^XUTL("XQ",$J)) D:$D(DUZ)#2 BYE^XUSCLEAN
I '$ESTACK G CONT
S $ETRAP="D UNWIND^ZU" ;Set new trap
S $ECODE=",<<HALT>>," ;Cause error to unwind stack
D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGOUT$")
Q
CONT ;
S $ECODE="",$ETRAP=""
D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGOUT$")
;Halt If User changed UCI's
I $&ZLIB.%GETSYM("DHCP$UCI_CHANGE") HALT
;Quit up to ZSLOT
I $L($&ZLIB.%GETSYM("ZSLOT")) QUIT
;Halt If a dialup line
S %=$&ZLIB.%GETDVI($I,"TT_DIALUP") I %!$D(XQXFLG("HALT")) HALT
;Halt If a Telnet connection
I ($P["_TNA")!$D(XQXFLG("HALT")) HALT
S X="Waiting "_($J#1000000) D SETENV^%ZOSV ;Change VMS name
;For sites that want to retain the connection, uncomment the next line
;U $I:NOCENABLE R !,"Enter return to continue: ",X:600 S:'$T X="^" G:X'="^" ^ZU
HALT
SLOT ;Entry point from ZSLOT
N ZIO,ZTIME
D LOG G EN
;
LOG ;Define some nessary Logical names for ZSLOT
S %=$&ZLIB.%CRELOG("SYS$INPUT",$I,"SUPERVISOR")
S %=$&ZLIB.%CRELOG("SYS$OUTPUT",$I,"SUPERVISOR")
S %=$&ZLIB.%CRELOG("SYS$COMMAND",$I,"SUPERVISOR")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HZUVXD 2967 printed Dec 13, 2024@02:16:45 Page 2
ZU ;SF/JLI,RWF - For DSM, TIE ALL TERMINALS TO THIS ROUTINE!! ;07/09/2001 13:31
+1 ;;8.0;KERNEL;**13,24,84,94,118,162,225**;Jul 10, 1995
+2 ;FOR VAX-DSM V5 & V6
EN ;See that escape processing is off, Conflict with Screenman
+1 SET X=$&ZLIB.%DISABLCTRL($CHAR(25))
USE $IO:(NOCENABLE:NOESCAPE)
+2 if +$GET(^%ZTSCH("LOGRSRC"))
DO LOGRSRC^%ZOSV("$LOGIN$")
+3 ;$&ZLIB.%TRNLNM("DECW$DISPLAY",,,,,"VALUE")
SET (ZUGUI1,ZUGUI2)=""
+4 NEW $ESTACK,$ETRAP
SET $ETRAP="S %ZTER11S=$STACK D ERR^ZU Q:$QUIT 0 Q"
+5 ;Only call ShareLic for Telnet connections.
+6 if $IO["_TNA"
DO SHARELIC^%ZOSV(0)
+7 GOTO ^XUS
+8 ;
G ;Entry point for GUI device.
+1 ;S ZUGUI1=1 G EN
QUIT
ERR ;Come here on error
+1 IF $ZE["STKOVR"
SET $ETRAP="Q:$ST>"_($STACK-8)_" D ERR2^ZU"
QUIT
ERR2 SET $ETRAP="D UNWIND^ZU"
LOCK
USE $IO:NOCENABLE
+1 if $ECODE["<PROG>"
QUIT
+2 IF $ZE["^XUS1A:2, %DSM-E-WRITERR"
GOTO HALT
+3 IF $GET(IO)]""
IF $DATA(IO(1,IO))
IF $EXTRACT($GET(IOST))="P"
USE IO
WRITE @$SELECT($DATA(IOF):IOF,1:"#")
+4 IF $GET(IO(0))]""
USE IO(0)
WRITE !!,"RECORDING THAT AN ERROR OCCURRED ---",!!?15,"Sorry 'bout that",!,*7,!?10,"$STACK=",$STACK," $ECODE=",$ECODE,!?10,"$ZERROR=",$ZERROR
+5 ; Capture symbol table first!
DO ^%ZTER
KILL %ZT
SET XUERF=""
+6 ; Halt immediately for disaster type FATAL errors
IF $DATA(%ZTERROR)
IF $PIECE(%ZTERROR,"^",2)="F"
HANG
+7 ;U $I:NOCENABLE D PROGMODE^%ZOSV I Y U $I:CENABLE Q
+8 IF $GET(DUZ)'>0
HALT
+9 ;
CTRLC IF $DATA(IO)=11
USE IO(0)
if IO'=IO(0)
CLOSE IO
SET IO=IO(0)
+1 if $ZE["-CTLC"
WRITE !,"--Interrupt Acknowledged",!
+2 ;Clean up symbol table
DO KILL1^XUSCLEAN
+3 SET $ECODE=",<<POP>>,"
+4 QUIT
+5 ;
UNWIND ;Unwind the stack
+1 if $ESTACK>1
QUIT
if $ECODE["<<HALT>>"
GOTO CONT
if $ECODE["<<POP>>"
GOTO CTRLC2
+2 SET $ECODE=""
+3 QUIT
+4 ;
CTRLC2 SET $ECODE=""
if $GET(^XUTL("XQ",$JOB,"T"))<2
GOTO ^XUSCLEAN
+1 SET ^XUTL("XQ",$JOB,"T")=1
SET XQY=$GET(^(1))
SET XQY0=$PIECE(XQY,"^",2,99)
+2 if $PIECE(XQY0,"^",4)'="M"
GOTO CTRLC2
+3 SET XQPSM=$PIECE(XQY,"^",1)
SET XQY=+XQPSM
SET XQPSM=$PIECE(XQPSM,XQY,2,3)
+4 if 'XQY
GOTO ^XUSCLEAN
+5 SET $ECODE=""
SET $ETRAP="S %ZTER11S=$STACK D ERR^ZU Q:$QUIT 0 Q"
+6 USE $IO:NOESCAPE
GOTO M1^XQ
+7 ;
HALT IF $DATA(^XUTL("XQ",$JOB))
if $DATA(DUZ)#2
DO BYE^XUSCLEAN
+1 IF '$ESTACK
GOTO CONT
+2 ;Set new trap
SET $ETRAP="D UNWIND^ZU"
+3 ;Cause error to unwind stack
SET $ECODE=",<<HALT>>,"
+4 if +$GET(^%ZTSCH("LOGRSRC"))
DO LOGRSRC^%ZOSV("$LOGOUT$")
+5 QUIT
CONT ;
+1 SET $ECODE=""
SET $ETRAP=""
+2 if +$GET(^%ZTSCH("LOGRSRC"))
DO LOGRSRC^%ZOSV("$LOGOUT$")
+3 ;Halt If User changed UCI's
+4 IF $&ZLIB.%GETSYM("DHCP$UCI_CHANGE")
HALT
+5 ;Quit up to ZSLOT
+6 IF $LENGTH($&ZLIB.%GETSYM("ZSLOT"))
QUIT
+7 ;Halt If a dialup line
+8 SET %=$&ZLIB.%GETDVI($IO,"TT_DIALUP")
IF %!$DATA(XQXFLG("HALT"))
HALT
+9 ;Halt If a Telnet connection
+10 IF ($PRINCIPAL["_TNA")!$DATA(XQXFLG("HALT"))
HALT
+11 ;Change VMS name
SET X="Waiting "_($JOB#1000000)
DO SETENV^%ZOSV
+12 ;For sites that want to retain the connection, uncomment the next line
+13 ;U $I:NOCENABLE R !,"Enter return to continue: ",X:600 S:'$T X="^" G:X'="^" ^ZU
+14 HALT
SLOT ;Entry point from ZSLOT
+1 NEW ZIO,ZTIME
+2 DO LOG
GOTO EN
+3 ;
LOG ;Define some nessary Logical names for ZSLOT
+1 SET %=$&ZLIB.%CRELOG("SYS$INPUT",$IO,"SUPERVISOR")
+2 SET %=$&ZLIB.%CRELOG("SYS$OUTPUT",$IO,"SUPERVISOR")
+3 SET %=$&ZLIB.%CRELOG("SYS$COMMAND",$IO,"SUPERVISOR")
+4 QUIT