CIAUINIT ;MSC/IND/DKM - Platform specific inits;04-May-2006 08:19;DKM
;;1.2;CIA UTILITIES;;Mar 20, 2007
;;Copyright 2000-2006, Medsphere Systems Corporation
;=================================================================
POST N CIAOS,CIAH,X
S U="^",X="ERROR^CIAUINIT",@^%ZOSF("TRAP"),CIAOS=$P(^%ZOSF("OS"),U,2)
I 'CIAOS D
.D HOME^%ZIS,TITLE^CIAU("Platform-Specific Inits",1.6)
.S CIAH(1)="Enter the name of this MUMPS environment for the CIA-namespace"
.S CIAH(2)="platform-specific initialization process."
.S CIAOS=$$ENTRY^CIAULKP("^DD(""OS"")","UX","Operating System: ","B","*","","",0,5,"","","HELP(.CIAH)")
.W !!
D:CIAOS>0 INIT(CIAOS)
Q
INIT(CIAOS) ;
N I,X,Y,Z,N,CIAOSZ
S CIAOSZ=$$OSRTN($G(CIAOS))
S:$L(CIAOSZ) @("CIAOSZ="_CIAOSZ)
I '$L(CIAOSZ) D Q
.X "ZL CIAUOS1 ZS CIAUOS"
.D MES("Init not found for specified OS. Will use generic init.")
S I=0,N="CIAU"
K ^TMP(N,$J)
F Z=0,1 F X=$S(Z:3,1:1):1 S Y=$T(+X^@$S(Z:CIAOSZ,1:"CIAUIN0")) Q:Y="" S I=I+1,^TMP(N,$J,I)=Y
S $P(^TMP(N,$J,1),";")="CIAUOS "
X "ZR F Z=1:1:I ZI ^TMP(N,$J,Z) ZS:Z=I CIAUOS"
K ^TMP(N,$J)
F Z=1:1 S X=$P($T(DEVICE+Z),";;",2,99) Q:X="" S ^TMP(N,$J,Z)=$$MSG^CIAU(X,"|")
I $$ENTRY^CIAUIMP($NA(^TMP(N,$J))) D
.D MES("Unable to install CIAU HFS DEVICE.")
W !!,"Initialization completed for "_$P(^DD("OS",CIAOS,0),"^")_" operating system.",!!
K ^TMP(N,$J)
Q
OSRTN(X) Q $P($T(@("OS"_X)),";",4,99)
OS8 ;;MSM;$S($ZV["UNIX":"CIAUIN58",1:"CIAUIN8")
OS16 ;;DSM;CIAUIN16
OS18 ;;Cache;$S($ZV["UNIX":"CIAUIN68",1:"CIAUIN18")
MES(X) D BMES^XPDUTL(X)
Q
ERROR D MES("An error has occurred during initialization.")
Q
; Return $I for HFS device
HFS() Q $S(CIAOS=16:"TEMP.TMP",CIAOS=8:51,CIAOS=18:"NUL",1:"@")
DEVICE ; Device setup
;;:3.5
;;.NAME: CIAU HFS DEVICE
;;.LOCATION OF TERMINAL: HFS
;;.$I: |$$HFS^CIAUINIT|
;;.SIGN-ON/SYSTEM DEVICE: N
;;.TYPE: HFS
;;.SUBTYPE: P-OTHER
;;.ASK DEVICE: N
;;.ASK PARAMETERS: N
;;.ASK HOST FILE: N
;;.ASK HFS I/O OPERATION: N
;;
CIAUINIT ;MSC/IND/DKM - Platform specific inits;04-May-2006 08:19;DKM
+1 ;;1.2;CIA UTILITIES;;Mar 20, 2007
+2 ;;Copyright 2000-2006, Medsphere Systems Corporation
+3 ;=================================================================
POST NEW CIAOS,CIAH,X
+1 SET U="^"
SET X="ERROR^CIAUINIT"
SET @^%ZOSF("TRAP")
SET CIAOS=$PIECE(^%ZOSF("OS"),U,2)
+2 IF 'CIAOS
Begin DoDot:1
+3 DO HOME^%ZIS
DO TITLE^CIAU("Platform-Specific Inits",1.6)
+4 SET CIAH(1)="Enter the name of this MUMPS environment for the CIA-namespace"
+5 SET CIAH(2)="platform-specific initialization process."
+6 SET CIAOS=$$ENTRY^CIAULKP("^DD(""OS"")","UX","Operating System: ","B","*","","",0,5,"","","HELP(.CIAH)")
+7 WRITE !!
End DoDot:1
+8 IF CIAOS>0
DO INIT(CIAOS)
+9 QUIT
INIT(CIAOS) ;
+1 NEW I,X,Y,Z,N,CIAOSZ
+2 SET CIAOSZ=$$OSRTN($GET(CIAOS))
+3 IF $LENGTH(CIAOSZ)
SET @("CIAOSZ="_CIAOSZ)
+4 IF '$LENGTH(CIAOSZ)
Begin DoDot:1
+5 XECUTE "ZL CIAUOS1 ZS CIAUOS"
+6 DO MES("Init not found for specified OS. Will use generic init.")
End DoDot:1
QUIT
+7 SET I=0
SET N="CIAU"
+8 KILL ^TMP(N,$JOB)
+9 FOR Z=0,1
FOR X=$SELECT(Z:3,1:1):1
SET Y=$TEXT(+X^@$SELECT(Z:CIAOSZ,1:"CIAUIN0"))
IF Y=""
QUIT
SET I=I+1
SET ^TMP(N,$JOB,I)=Y
+10 SET $PIECE(^TMP(N,$JOB,1),";")="CIAUOS "
+11 XECUTE "ZR F Z=1:1:I ZI ^TMP(N,$J,Z) ZS:Z=I CIAUOS"
+12 KILL ^TMP(N,$JOB)
+13 FOR Z=1:1
SET X=$PIECE($TEXT(DEVICE+Z),";;",2,99)
IF X=""
QUIT
SET ^TMP(N,$JOB,Z)=$$MSG^CIAU(X,"|")
+14 IF $$ENTRY^CIAUIMP($NAME(^TMP(N,$JOB)))
Begin DoDot:1
+15 DO MES("Unable to install CIAU HFS DEVICE.")
End DoDot:1
+16 WRITE !!,"Initialization completed for "_$PIECE(^DD("OS",CIAOS,0),"^")_" operating system.",!!
+17 KILL ^TMP(N,$JOB)
+18 QUIT
OSRTN(X) QUIT $PIECE($TEXT(@("OS"_X)),";",4,99)
OS8 ;;MSM;$S($ZV["UNIX":"CIAUIN58",1:"CIAUIN8")
OS16 ;;DSM;CIAUIN16
OS18 ;;Cache;$S($ZV["UNIX":"CIAUIN68",1:"CIAUIN18")
MES(X) DO BMES^XPDUTL(X)
+1 QUIT
ERROR DO MES("An error has occurred during initialization.")
+1 QUIT
+2 ; Return $I for HFS device
HFS() QUIT $SELECT(CIAOS=16:"TEMP.TMP",CIAOS=8:51,CIAOS=18:"NUL",1:"@")
DEVICE ; Device setup
+1 ;;:3.5
+2 ;;.NAME: CIAU HFS DEVICE
+3 ;;.LOCATION OF TERMINAL: HFS
+4 ;;.$I: |$$HFS^CIAUINIT|
+5 ;;.SIGN-ON/SYSTEM DEVICE: N
+6 ;;.TYPE: HFS
+7 ;;.SUBTYPE: P-OTHER
+8 ;;.ASK DEVICE: N
+9 ;;.ASK PARAMETERS: N
+10 ;;.ASK HOST FILE: N
+11 ;;.ASK HFS I/O OPERATION: N
+12 ;;