Annotation of freem/mlib/%SYSINIT.m, revision 1.8
1.5 snw 1: %SYSINIT ;VCL/SNW-FREEM STARTUP ROUTINE; 5/1/2025 11:00 AM
1.2 snw 2: ;0.0;FreeM;****FREEM**;Serena Willis @2020
1.1 snw 3: ;
1.8 ! snw 4: ; $Id: %SYSINIT.m,v 1.7 2025/05/03 04:05:23 snw Exp $
1.1 snw 5: ; FreeM Startup Routine
6: ;
7: ;
1.3 snw 8: ; Author: Serena Willis <snw@coherent-logic.com>
1.1 snw 9: ; Copyright (C) 1998 MUG Deutschland
10: ; Copyright (C) 2020, 2022 Coherent Logic Development LLC
11: ;
12: ;
13: ; This file is part of FreeM.
14: ;
15: ; FreeM is free software: you can redistribute it and/or modify
16: ; it under the terms of the GNU Affero Public License as published by
17: ; the Free Software Foundation, either version 3 of the License, or
18: ; (at your option) any later version.
19: ;
20: ; FreeM is distributed in the hope that it will be useful,
21: ; but WITHOUT ANY WARRANTY; without even the implied warranty of
22: ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23: ; GNU Affero Public License for more details.
24: ;
25: ; You should have received a copy of the GNU Affero Public License
26: ; along with FreeM. If not, see <https://www.gnu.org/licenses/>.
1.3 snw 27: ;
1.4 snw 28: ; $Log: %SYSINIT.m,v $
1.8 ! snw 29: ; Revision 1.7 2025/05/03 04:05:23 snw
! 30: ; Fix %SYSINIT
! 31: ;
1.7 snw 32: ; Revision 1.6 2025/05/02 12:44:48 snw
33: ; Documentation updates
34: ;
1.6 snw 35: ; Revision 1.5 2025/05/01 17:02:30 snw
36: ; Further debugging improvements
37: ;
1.5 snw 38: ; Revision 1.4 2025/04/10 14:37:20 snw
39: ; Updates to manual
40: ;
1.4 snw 41: ; Revision 1.3 2025/03/10 00:38:15 snw
42: ; Phase 3 of REUSE compliance and header reformatting
43: ;
1.3 snw 44: ;
45: ; SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
46: ; SPDX-License-Identifier: AGPL-3.0-or-later
1.1 snw 47: S %DIA=$DIALECT
48: S $DIALECT="FREEM"
1.8 ! snw 49: ZCONST %MATH("PI")=3.141592653589793238462
! 50: ZCONST %MATH("E")=2.71828182845904523536
! 51: ZCONST %MATH("GAMMA")=0.57721566490153286060
! 52: ZCONST %MATH("DEGPERRAD")=57.29577951308232087680
! 53: ZCONST %MATH("PHI")=1.61803398874989484820
! 54: ZCONST %IO("CRLF")=$C(13,10)
! 55: ZCONST %SYS("SIGNAL","HUP")=1
! 56: ZCONST %SYS("SIGNAL","INIT")=2
! 57: ZCONST %SYS("SIGNAL","KILL")=9
! 58: ZCONST %SYS("SIGNAL","TERM")=15
1.1 snw 59: ASTART "TRIGGER"
60: S $ZTRAP="NOLS^%SYSINIT"
61: D ^LCLINIT
62: NOLS ;
63: S $ZTRAP=""
64: S $DIALECT=%DIA
65: K %DIA
66: I $D(%TMPINITROUTINE) D @%TMPINITROUTINE G RTNDONE
67: I $D(%TMPINITMCODE) @%TMPINITMCODE
68: RTNDONE ;
69: Q
70: copyright ;
71: COPYRIGHT ;
72: S %DIA=$DIALECT
73: S $DIALECT="FREEM"
74: W "Coherent Logic Development ",$ZVERSION,!
1.6 snw 75: W "Copyright (C) 2014, 2025 Coherent Logic Development LLC",!,!
1.1 snw 76: W "License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/license/agpl-3.0.html>",!
77: W "This is free software: you are free to change and redistribute it.",!
78: W "There is NO WARRANTY, to the extent permitted by law.",!,!
79: S $DIALECT=%DIA
80: K %DIA
81: Q
82: limits ;
83: LIMITS ;
84: S %DIA=$DIALECT
85: S $DIALECT="FREEM"
86: N MWAPI S MWAPI="<<DISABLED>>"
87: S:^$SYSTEM("MWAPI") MWAPI=^$DISPLAY($PDISPLAY,"PLATFORM")
88: W !,$ZVERSION," - System Limits",!!
89: W " MAX NAME LENGTH: ",^$SYSTEM("NAME_LENGTH"),!
90: W " MAX NODE LENGTH: ",^$SYSTEM("STRING_MAX"),!
91: W " MWAPI SUPPORT: ",MWAPI,!
92: I MWAPI'="<<DISABLED>>" THEN D
93: . W " DISPLAY: ",$PDISPLAY,!
94: . W " RESOLUTION: ",^$DISPLAY($PDISPLAY,"SIZE"),!
95: . W " COLOR SPECTRUM: ",^$DISPLAY($PDISPLAY,"SPECTRUM"),!
96: . W " COLOR TYPE: ",^$DISPLAY($PDISPLAY,"COLORTYPE"),!
97: . W " SCREEN UNITS: ",^$DISPLAY($PDISPLAY,"UNITS"),!
98: S $DIALECT=%DIA
99: K %DIA
100: Q
101: info ;
102: INFO ;
103: S %DIA=$DIALECT
104: S $DIALECT="FREEM"
105: N NS S NS=^$JOB($JOB,"NAMESPACE")
106: W $ZVERSION," (Namespace ",^$JOB($JOB,"NAMESPACE"),")",!,!
107: W "USER-DEFINED LANGUAGE ELEMENTS:",!
108: W " Intrinsic Z-Commands: ",!
109: W " Intrinsic Z-Functions: ",!
110: W " Intrinsic Special Variables: ",!!
111: W "EVENT MANAGEMENT:",!
112: W " BREAK Service Code: '",!!
113: W "GLOBAL DATABASE:",!
114: W " Global Handler: ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
115: S NS="SYSTEM"
116: W " -> ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
117: W " Last Referenced Global: ",$REFERENCE,!
118: W " Characters in Unique Name: ",^$JOB($JOB,"GVN_UNIQUE_CHARS"),!
119: W " Case Sensitivity: ",^$JOB($JOB,"GVN_CASE_SENSITIVE"),!
120: W " Max Length (Global Name + Subscripts): ",^$JOB($JOB,"GVN_NAME_SUB_LENGTH"),!
121: W " Max Length (Each Subscript): ",^$JOB($JOB,"GVN_SUB_LENGTH"),!
122: S $DIALECT=%DIA
123: K %DIA
124: Q
125: jobs ;
126: JOBS ;
127: S %DIA=$DIALECT
128: S $DIALECT="FREEM"
129: W " -== ",$ZVERSION," Job Manager ==-",!,!
130: jmmnu ;%DIALECT FREEM
131: W "PID",?7,"NAMESPACE",?20,"ROUTINE",?41,"$PRINCIPAL",?63,"UID:GID",!
132: W "---",?7,"---------",?20,"-------",?41,"----------",?63,"-------",!
133: S PID=""
134: F S PID=$O(^$JOB(PID)) Q:PID="" D
135: . W PID,?7,^$JOB(PID,"NAMESPACE"),?20,^$JOB(PID,"ROUTINE"),?41,^$JOB(PID,"$PRINCIPAL")
136: . W ?63,^$JOB(PID,"USER"),":",^$JOB(PID,"GROUP")
137: . I PID=$JOB W "*",!
138: . I PID'=$JOB W !
139: W !
140: W "'*' represents the current process.",!
141: W "Type 'quit' at the prompt to quit the Job Manager.",!,!
142: gpid ;
143: W "PID> " R PID W !
144: I PID="quit" S $DIALECT=%DIA K %DIA QUIT
145: I '$D(^$JOB(PID)) W "Invalid PID",! G gpid
146: W "Job PID "_PID_":",!
147: W " Current Namespace: ",^$JOB(PID,"NAMESPACE"),!
148: W " Current Routine: ",^$JOB(PID,"ROUTINE"),!
149: W " Value of $PRINCIPAL: ",^$JOB(PID,"$PRINCIPAL"),!
150: W " Value of $IO: ",^$JOB(PID,"$IO"),!
151: W " Process Owner: ",^$JOB(PID,"USER"),!
152: W " Process Group: ",^$JOB(PID,"GROUP"),!
153: W " Process $TLEVEL: ",^$JOB(PID,"$TLEVEL"),!,!
154: jsel ;
155: W "h)alt PID "_PID_" or c)hoose another? " R ACT#1
156: I (ACT="h")!(ACT="H") K ^$JOB(PID) W !,"Sent SIGTERM to process "_PID_".",! G jmmnu
157: W !,! G jmmnu
158: S $DIALECT=%DIA
159: K %DIA
160: Q
161: TRMSTAT ;
162: trmstat ;
163: S %DIA=$DIALECT
164: S $DIALECT="FREEM"
165: W !,"FreeM Terminal Status",!
166: W "---------------------",!,!
167: W "ECHOON = "_^$DEVICE($P,"ECHOON")_" DELMODE = "_^$DEVICE($P,"DELMODE")_" ESCSEQPROC = "_^$DEVICE($P,"ESCSEQPROC"),!
168: W "CONVUPPER = "_^$DEVICE($P,"CONVUPPER")_" DELEMPTY = "_^$DEVICE($P,"DELEMPTY")_" NOCTRLS = "_^$DEVICE($P,"NOCTRLS"),!
169: W "CTRLOPROC = "_^$DEVICE($P,"CTRLOPROC")_" NOTYPEAHEAD = "_^$DEVICE($P,"NOTYPEAHEAD")_" TERMID = "_^$DEVICE($P,"TERMID"),!,!
170: W "Device Status Word is "_^$DEVICE($P,"DSW"),!,!
171: S $DIALECT=%DIA K %DIA
172: Q
173: GLOBAL ;
174: global ;
175: S %DIA=$DIALECT
176: S $DIALECT="FREEM"
177: N GBLNAM,G
178: W !,"Which global (including ^)? "
179: R GBLNAM W !!
180: I '$D(GBLNAM) W "Invalid global?",! G GLOBAL
181: S G=$E(GBLNAM,2,$L(GBLNAM))
182: W "GLOBAL: ",GBLNAM,!
183: W "NAMESPACE: ",^$GLOBAL(G,"NAMESPACE")
184: I $D(^$SYSTEM("MAPPINGS","GLOBAL",GBLNAM)) W " [mapped]",!
185: E W !
186: W "DATA FILE: ",^$GLOBAL(G,"FILE"),!
187: S $DIALECT=%DIA K %DIA
188: Q
189: rw ;
190: S %DIA=$DIALECT
191: S $DIALECT="FREEM"
192: W !,"---=== PROFESSOR RICHARD WALTERS ===---",!!
193: W "UC Davis professor Richard Walters, the former director of the",!
194: W "FreeM project, died on January 18, 2021 at the age of 90.",!,!
195: W "The FreeM project--and the M community--owes him a great debt",!
196: W "of gratitude.",!,!
197: W "Rest in power, Professor Walters.",!,!
198: W "Sincerely,",!
199: W " - The FreeM Project",!,!
200: S $DIALECT=%DIA K %DIA
201: Q
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>