Annotation of freem/mlib/%SYSINIT.m, revision 1.5
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.5 ! snw 4: ; $Id: %SYSINIT.m,v 1.4 2025/04/10 14:37:20 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.5 ! snw 29: ; Revision 1.4 2025/04/10 14:37:20 snw
! 30: ; Updates to manual
! 31: ;
1.4 snw 32: ; Revision 1.3 2025/03/10 00:38:15 snw
33: ; Phase 3 of REUSE compliance and header reformatting
34: ;
1.3 snw 35: ;
36: ; SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
37: ; SPDX-License-Identifier: AGPL-3.0-or-later
1.1 snw 38: S %DIA=$DIALECT
39: S $DIALECT="FREEM"
1.4 snw 40: CONST %MATHPI=3.141592653589793238462
41: CONST %MATHE=2.71828182845904523536
42: CONST %MATHGAMMA=0.57721566490153286060
43: CONST %MATHDEGPERRAD=57.29577951308232087680
44: CONST %MATHPHI=1.61803398874989484820
45: CONST %IOCRLF=$C(13,10)
46: CONST %SYSSIGNALHUP=1
47: CONST %SYSSIGNALINT=2
48: CONST %SYSSIGNALKILL=9
49: CONST %SYSSIGNALTERM=15
1.1 snw 50: ASTART "TRIGGER"
51: S $ZTRAP="NOLS^%SYSINIT"
52: D ^LCLINIT
53: NOLS ;
54: S $ZTRAP=""
55: S $DIALECT=%DIA
56: K %DIA
57: I $D(%TMPINITROUTINE) D @%TMPINITROUTINE G RTNDONE
58: I $D(%TMPINITMCODE) @%TMPINITMCODE
59: RTNDONE ;
60: Q
61: copyright ;
62: COPYRIGHT ;
63: S %DIA=$DIALECT
64: S $DIALECT="FREEM"
65: W "Coherent Logic Development ",$ZVERSION,!
66: W "Copyright (C) 2014, 2020, 2021 Coherent Logic Development LLC",!,!
67: W "License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/license/agpl-3.0.html>",!
68: W "This is free software: you are free to change and redistribute it.",!
69: W "There is NO WARRANTY, to the extent permitted by law.",!,!
70: S $DIALECT=%DIA
71: K %DIA
72: Q
73: limits ;
74: LIMITS ;
75: S %DIA=$DIALECT
76: S $DIALECT="FREEM"
77: N MWAPI S MWAPI="<<DISABLED>>"
78: S:^$SYSTEM("MWAPI") MWAPI=^$DISPLAY($PDISPLAY,"PLATFORM")
79: W !,$ZVERSION," - System Limits",!!
80: W " MAX NAME LENGTH: ",^$SYSTEM("NAME_LENGTH"),!
81: W " MAX NODE LENGTH: ",^$SYSTEM("STRING_MAX"),!
82: W " MWAPI SUPPORT: ",MWAPI,!
83: I MWAPI'="<<DISABLED>>" THEN D
84: . W " DISPLAY: ",$PDISPLAY,!
85: . W " RESOLUTION: ",^$DISPLAY($PDISPLAY,"SIZE"),!
86: . W " COLOR SPECTRUM: ",^$DISPLAY($PDISPLAY,"SPECTRUM"),!
87: . W " COLOR TYPE: ",^$DISPLAY($PDISPLAY,"COLORTYPE"),!
88: . W " SCREEN UNITS: ",^$DISPLAY($PDISPLAY,"UNITS"),!
89: S $DIALECT=%DIA
90: K %DIA
91: Q
92: info ;
93: INFO ;
94: S %DIA=$DIALECT
95: S $DIALECT="FREEM"
96: N NS S NS=^$JOB($JOB,"NAMESPACE")
97: W $ZVERSION," (Namespace ",^$JOB($JOB,"NAMESPACE"),")",!,!
98: W "USER-DEFINED LANGUAGE ELEMENTS:",!
99: W " Intrinsic Z-Commands: ",!
100: W " Intrinsic Z-Functions: ",!
101: W " Intrinsic Special Variables: ",!!
102: W "EVENT MANAGEMENT:",!
103: W " BREAK Service Code: '",!!
104: W "GLOBAL DATABASE:",!
105: W " Global Handler: ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
106: S NS="SYSTEM"
107: W " -> ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
108: W " Last Referenced Global: ",$REFERENCE,!
109: W " Characters in Unique Name: ",^$JOB($JOB,"GVN_UNIQUE_CHARS"),!
110: W " Case Sensitivity: ",^$JOB($JOB,"GVN_CASE_SENSITIVE"),!
111: W " Max Length (Global Name + Subscripts): ",^$JOB($JOB,"GVN_NAME_SUB_LENGTH"),!
112: W " Max Length (Each Subscript): ",^$JOB($JOB,"GVN_SUB_LENGTH"),!
113: S $DIALECT=%DIA
114: K %DIA
115: Q
116: jobs ;
117: JOBS ;
118: S %DIA=$DIALECT
119: S $DIALECT="FREEM"
120: W " -== ",$ZVERSION," Job Manager ==-",!,!
121: jmmnu ;%DIALECT FREEM
122: W "PID",?7,"NAMESPACE",?20,"ROUTINE",?41,"$PRINCIPAL",?63,"UID:GID",!
123: W "---",?7,"---------",?20,"-------",?41,"----------",?63,"-------",!
124: S PID=""
125: F S PID=$O(^$JOB(PID)) Q:PID="" D
126: . W PID,?7,^$JOB(PID,"NAMESPACE"),?20,^$JOB(PID,"ROUTINE"),?41,^$JOB(PID,"$PRINCIPAL")
127: . W ?63,^$JOB(PID,"USER"),":",^$JOB(PID,"GROUP")
128: . I PID=$JOB W "*",!
129: . I PID'=$JOB W !
130: W !
131: W "'*' represents the current process.",!
132: W "Type 'quit' at the prompt to quit the Job Manager.",!,!
133: gpid ;
134: W "PID> " R PID W !
135: I PID="quit" S $DIALECT=%DIA K %DIA QUIT
136: I '$D(^$JOB(PID)) W "Invalid PID",! G gpid
137: W "Job PID "_PID_":",!
138: W " Current Namespace: ",^$JOB(PID,"NAMESPACE"),!
139: W " Current Routine: ",^$JOB(PID,"ROUTINE"),!
140: W " Value of $PRINCIPAL: ",^$JOB(PID,"$PRINCIPAL"),!
141: W " Value of $IO: ",^$JOB(PID,"$IO"),!
142: W " Process Owner: ",^$JOB(PID,"USER"),!
143: W " Process Group: ",^$JOB(PID,"GROUP"),!
144: W " Process $TLEVEL: ",^$JOB(PID,"$TLEVEL"),!,!
145: jsel ;
146: W "h)alt PID "_PID_" or c)hoose another? " R ACT#1
147: I (ACT="h")!(ACT="H") K ^$JOB(PID) W !,"Sent SIGTERM to process "_PID_".",! G jmmnu
148: W !,! G jmmnu
149: S $DIALECT=%DIA
150: K %DIA
151: Q
152: TRMSTAT ;
153: trmstat ;
154: S %DIA=$DIALECT
155: S $DIALECT="FREEM"
156: W !,"FreeM Terminal Status",!
157: W "---------------------",!,!
158: W "ECHOON = "_^$DEVICE($P,"ECHOON")_" DELMODE = "_^$DEVICE($P,"DELMODE")_" ESCSEQPROC = "_^$DEVICE($P,"ESCSEQPROC"),!
159: W "CONVUPPER = "_^$DEVICE($P,"CONVUPPER")_" DELEMPTY = "_^$DEVICE($P,"DELEMPTY")_" NOCTRLS = "_^$DEVICE($P,"NOCTRLS"),!
160: W "CTRLOPROC = "_^$DEVICE($P,"CTRLOPROC")_" NOTYPEAHEAD = "_^$DEVICE($P,"NOTYPEAHEAD")_" TERMID = "_^$DEVICE($P,"TERMID"),!,!
161: W "Device Status Word is "_^$DEVICE($P,"DSW"),!,!
162: S $DIALECT=%DIA K %DIA
163: Q
164: GLOBAL ;
165: global ;
166: S %DIA=$DIALECT
167: S $DIALECT="FREEM"
168: N GBLNAM,G
169: W !,"Which global (including ^)? "
170: R GBLNAM W !!
171: I '$D(GBLNAM) W "Invalid global?",! G GLOBAL
172: S G=$E(GBLNAM,2,$L(GBLNAM))
173: W "GLOBAL: ",GBLNAM,!
174: W "NAMESPACE: ",^$GLOBAL(G,"NAMESPACE")
175: I $D(^$SYSTEM("MAPPINGS","GLOBAL",GBLNAM)) W " [mapped]",!
176: E W !
177: W "DATA FILE: ",^$GLOBAL(G,"FILE"),!
178: S $DIALECT=%DIA K %DIA
179: Q
180: rw ;
181: S %DIA=$DIALECT
182: S $DIALECT="FREEM"
183: W !,"---=== PROFESSOR RICHARD WALTERS ===---",!!
184: W "UC Davis professor Richard Walters, the former director of the",!
185: W "FreeM project, died on January 18, 2021 at the age of 90.",!,!
186: W "The FreeM project--and the M community--owes him a great debt",!
187: W "of gratitude.",!,!
188: W "Rest in power, Professor Walters.",!,!
189: W "Sincerely,",!
190: W " - The FreeM Project",!,!
191: S $DIALECT=%DIA K %DIA
192: Q
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>