%SYSINIT ;VCL/SNW-FREEM STARTUP ROUTINE; 5/1/2025 11:00 AM ;0.0;FreeM;****FREEM**;Serena Willis @2020 ; ; $Id: %SYSINIT.m,v 1.8 2025/05/05 04:46:35 snw Exp $ ; FreeM Startup Routine ; ; ; Author: Serena Willis ; Copyright (C) 1998 MUG Deutschland ; Copyright (C) 2020, 2022 Coherent Logic Development LLC ; ; ; This file is part of FreeM. ; ; FreeM is free software: you can redistribute it and/or modify ; it under the terms of the GNU Affero Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; FreeM is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU Affero Public License for more details. ; ; You should have received a copy of the GNU Affero Public License ; along with FreeM. If not, see . ; ; $Log: %SYSINIT.m,v $ ; Revision 1.8 2025/05/05 04:46:35 snw ; Documentation fixes; make FreeM more standards compliant ; ; Revision 1.7 2025/05/03 04:05:23 snw ; Fix %SYSINIT ; ; Revision 1.6 2025/05/02 12:44:48 snw ; Documentation updates ; ; Revision 1.5 2025/05/01 17:02:30 snw ; Further debugging improvements ; ; Revision 1.4 2025/04/10 14:37:20 snw ; Updates to manual ; ; Revision 1.3 2025/03/10 00:38:15 snw ; Phase 3 of REUSE compliance and header reformatting ; ; ; SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC ; SPDX-License-Identifier: AGPL-3.0-or-later S %DIA=$DIALECT S $DIALECT="FREEM" ZCONST %MATH("PI")=3.141592653589793238462 ZCONST %MATH("E")=2.71828182845904523536 ZCONST %MATH("GAMMA")=0.57721566490153286060 ZCONST %MATH("DEGPERRAD")=57.29577951308232087680 ZCONST %MATH("PHI")=1.61803398874989484820 ZCONST %IO("CRLF")=$C(13,10) ZCONST %SYS("SIGNAL","HUP")=1 ZCONST %SYS("SIGNAL","INIT")=2 ZCONST %SYS("SIGNAL","KILL")=9 ZCONST %SYS("SIGNAL","TERM")=15 ASTART "TRIGGER" S $ZTRAP="NOLS^%SYSINIT" D ^LCLINIT NOLS ; S $ZTRAP="" S $DIALECT=%DIA K %DIA I $D(%TMPINITROUTINE) D @%TMPINITROUTINE G RTNDONE I $D(%TMPINITMCODE) @%TMPINITMCODE RTNDONE ; Q copyright ; COPYRIGHT ; S %DIA=$DIALECT S $DIALECT="FREEM" W "Coherent Logic Development ",$ZVERSION,! W "Copyright (C) 2014, 2025 Coherent Logic Development LLC",!,! W "License AGPLv3+: GNU AGPL version 3 or later ",! W "This is free software: you are free to change and redistribute it.",! W "There is NO WARRANTY, to the extent permitted by law.",!,! S $DIALECT=%DIA K %DIA Q limits ; LIMITS ; S %DIA=$DIALECT S $DIALECT="FREEM" N MWAPI S MWAPI="<>" S:^$SYSTEM("MWAPI") MWAPI=^$DISPLAY($PDISPLAY,"PLATFORM") W !,$ZVERSION," - System Limits",!! W " MAX NAME LENGTH: ",^$SYSTEM("NAME_LENGTH"),! W " MAX NODE LENGTH: ",^$SYSTEM("STRING_MAX"),! W " MWAPI SUPPORT: ",MWAPI,! I MWAPI'="<>" THEN D . W " DISPLAY: ",$PDISPLAY,! . W " RESOLUTION: ",^$DISPLAY($PDISPLAY,"SIZE"),! . W " COLOR SPECTRUM: ",^$DISPLAY($PDISPLAY,"SPECTRUM"),! . W " COLOR TYPE: ",^$DISPLAY($PDISPLAY,"COLORTYPE"),! . W " SCREEN UNITS: ",^$DISPLAY($PDISPLAY,"UNITS"),! S $DIALECT=%DIA K %DIA Q info ; INFO ; S %DIA=$DIALECT S $DIALECT="FREEM" N NS S NS=^$JOB($JOB,"NAMESPACE") W $ZVERSION," (Namespace ",^$JOB($JOB,"NAMESPACE"),")",!,! W "USER-DEFINED LANGUAGE ELEMENTS:",! W " Intrinsic Z-Commands: ",! W " Intrinsic Z-Functions: ",! W " Intrinsic Special Variables: ",!! W "EVENT MANAGEMENT:",! W " BREAK Service Code: '",!! W "GLOBAL DATABASE:",! W " Global Handler: ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),! S NS="SYSTEM" W " -> ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),! W " Last Referenced Global: ",$REFERENCE,! W " Characters in Unique Name: ",^$JOB($JOB,"GVN_UNIQUE_CHARS"),! W " Case Sensitivity: ",^$JOB($JOB,"GVN_CASE_SENSITIVE"),! W " Max Length (Global Name + Subscripts): ",^$JOB($JOB,"GVN_NAME_SUB_LENGTH"),! W " Max Length (Each Subscript): ",^$JOB($JOB,"GVN_SUB_LENGTH"),! S $DIALECT=%DIA K %DIA Q jobs ; JOBS ; S %DIA=$DIALECT S $DIALECT="FREEM" W " -== ",$ZVERSION," Job Manager ==-",!,! jmmnu ;%DIALECT FREEM W "PID",?7,"NAMESPACE",?20,"ROUTINE",?41,"$PRINCIPAL",?63,"UID:GID",! W "---",?7,"---------",?20,"-------",?41,"----------",?63,"-------",! S PID="" F S PID=$O(^$JOB(PID)) Q:PID="" D . W PID,?7,^$JOB(PID,"NAMESPACE"),?20,^$JOB(PID,"ROUTINE"),?41,^$JOB(PID,"$PRINCIPAL") . W ?63,^$JOB(PID,"USER"),":",^$JOB(PID,"GROUP") . I PID=$JOB W "*",! . I PID'=$JOB W ! W ! W "'*' represents the current process.",! W "Type 'quit' at the prompt to quit the Job Manager.",!,! gpid ; W "PID> " R PID W ! I PID="quit" S $DIALECT=%DIA K %DIA QUIT I '$D(^$JOB(PID)) W "Invalid PID",! G gpid W "Job PID "_PID_":",! W " Current Namespace: ",^$JOB(PID,"NAMESPACE"),! W " Current Routine: ",^$JOB(PID,"ROUTINE"),! W " Value of $PRINCIPAL: ",^$JOB(PID,"$PRINCIPAL"),! W " Value of $IO: ",^$JOB(PID,"$IO"),! W " Process Owner: ",^$JOB(PID,"USER"),! W " Process Group: ",^$JOB(PID,"GROUP"),! W " Process $TLEVEL: ",^$JOB(PID,"$TLEVEL"),!,! jsel ; W "h)alt PID "_PID_" or c)hoose another? " R ACT#1 I (ACT="h")!(ACT="H") K ^$JOB(PID) W !,"Sent SIGTERM to process "_PID_".",! G jmmnu W !,! G jmmnu S $DIALECT=%DIA K %DIA Q TRMSTAT ; trmstat ; S %DIA=$DIALECT S $DIALECT="FREEM" W !,"FreeM Terminal Status",! W "---------------------",!,! W "ECHOON = "_^$DEVICE($P,"ECHOON")_" DELMODE = "_^$DEVICE($P,"DELMODE")_" ESCSEQPROC = "_^$DEVICE($P,"ESCSEQPROC"),! W "CONVUPPER = "_^$DEVICE($P,"CONVUPPER")_" DELEMPTY = "_^$DEVICE($P,"DELEMPTY")_" NOCTRLS = "_^$DEVICE($P,"NOCTRLS"),! W "CTRLOPROC = "_^$DEVICE($P,"CTRLOPROC")_" NOTYPEAHEAD = "_^$DEVICE($P,"NOTYPEAHEAD")_" TERMID = "_^$DEVICE($P,"TERMID"),!,! W "Device Status Word is "_^$DEVICE($P,"DSW"),!,! S $DIALECT=%DIA K %DIA Q GLOBAL ; global ; S %DIA=$DIALECT S $DIALECT="FREEM" N GBLNAM,G W !,"Which global (including ^)? " R GBLNAM W !! I '$D(GBLNAM) W "Invalid global?",! G GLOBAL S G=$E(GBLNAM,2,$L(GBLNAM)) W "GLOBAL: ",GBLNAM,! W "NAMESPACE: ",^$GLOBAL(G,"NAMESPACE") I $D(^$SYSTEM("MAPPINGS","GLOBAL",GBLNAM)) W " [mapped]",! E W ! W "DATA FILE: ",^$GLOBAL(G,"FILE"),! S $DIALECT=%DIA K %DIA Q rw ; S %DIA=$DIALECT S $DIALECT="FREEM" W !,"---=== PROFESSOR RICHARD WALTERS ===---",!! W "UC Davis professor Richard Walters, the former director of the",! W "FreeM project, died on January 18, 2021 at the age of 90.",!,! W "The FreeM project--and the M community--owes him a great debt",! W "of gratitude.",!,! W "Rest in power, Professor Walters.",!,! W "Sincerely,",! W " - The FreeM Project",!,! S $DIALECT=%DIA K %DIA Q