Listing: 1 IMPLEMENTATION MODULE Diagnostics; 2 (* 3 * REPERTOIRE 4 * Release 1.6 5 * By Charles Bradford and Cole Brecheen 6 * (c) Copyright 1985-1992 PMI 7 * Green Bay, Wisconsin 8 * All rights reserved 9 * (414) 468-6040 10 * 11 * $Header: D:/logfiles/mods/diagnost.mov 1.6 10 Mar 1991 15:26:18 coleb $ 12 * 13 *) 14 15 16 IMPORT FAPI; (*Diag*) 17 18 IMPORT ErrorManager; 19 IMPORT HandleIO; 20 IMPORT GenLists; 21 IMPORT LowLevel; 22 IMPORT M2Strings; 23 IMPORT StrConv; 24 IMPORT StrEdit; 25 IMPORT StringIO; 26 IMPORT SYSTEM; 27 28 VAR 29 Initialized : BOOLEAN; 30 31 PROCEDURE Init(); 32 BEGIN 33 IF Initialized THEN 34 RETURN; 35 ELSE 36 Initialized := TRUE; 37 END; 38 ErrorManager.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 39 HandleIO.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 40 GenLists.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 41 LowLevel.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 42 M2Strings.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 43 StrConv.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 44 StrEdit.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 45 StringIO.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 46 END Init; ***** ^ not supported yet 47 48 49 PROCEDURE diagA(str1 : ARRAY OF CHAR; TheAddr : SYSTEM.ADDRESS ); ***** ^ not supported yet ***** ^ not supported yet 50 VAR 51 LocalStr: ARRAY [0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 52 dummy : ARRAY [0..5] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 53 BEGIN 54 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 55 StrEdit.Append( LocalStr, ': ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 56 StrConv.CardinalToStr(LowLevel.seg(TheAddr), 0, dummy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 57 StrEdit.Append( LocalStr, dummy ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 StrEdit.Append( LocalStr, ':' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 59 StrConv.CardinalToStr(LowLevel.ofs(TheAddr), 0, dummy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 60 StrEdit.Append( LocalStr, dummy ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 61 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 62 END diagA; ***** ^ not supported yet 63 64 65 PROCEDURE diagB( str1: ARRAY OF CHAR; TheSet: BITSET ); ***** ^ not supported yet ***** ^ undeclared identifier 66 VAR 67 cnt: CARDINAL; 68 LocalStr: ARRAY [0..255] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 69 BEGIN 70 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 71 StrEdit.Append( LocalStr, ' ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 72 FOR cnt := 0 TO 15 DO 73 IF cnt IN TheSet THEN ***** ^ not supported yet 74 StrEdit.Append( LocalStr, '1' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 75 ELSE 76 StrEdit.Append( LocalStr, '0' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 77 END; 78 END; 79 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 80 END diagB; ***** ^ not supported yet 81 82 83 PROCEDURE diagS(str1, str2 : ARRAY OF CHAR); ***** ^ not supported yet 84 VAR 85 LocalStr: ARRAY [0..255] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 86 dummy, lngth: CARDINAL; 87 tmpadr: SYSTEM.ADDRESS; ***** ^ not supported yet 88 BEGIN 89 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 90 StrEdit.Append( LocalStr, ' "' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 91 StrEdit.Append( LocalStr, str2 ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 92 StrEdit.Append( LocalStr, '"' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 93 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 94 (* 95 tmpadr := SYSTEM.ADR(LocalStr); 96 lngth := M2Strings.Length(LocalStr); 97 dummy := FAPI.DOSWRITE( 1, tmpadr, lngth, SYSTEM.ADR(dummy) ); 98 *) 99 END diagS; ***** ^ not supported yet 100 101 102 PROCEDURE diagC(str1 : ARRAY OF CHAR; TheCard : CARDINAL); ***** ^ not supported yet 103 VAR 104 LocalStr: ARRAY [0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 105 dummy : ARRAY [0..5] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 106 BEGIN 107 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 108 StrEdit.Append( LocalStr, ': ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 109 StrConv.CardinalToStr(TheCard, 0, dummy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 110 StrEdit.Append( LocalStr, dummy ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 111 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 112 END diagC; ***** ^ not supported yet 113 114 115 PROCEDURE diagI(str1 : ARRAY OF CHAR; TheInt : ***** ^ not supported yet 116 INTEGER); 117 VAR 118 LocalStr: ARRAY [0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 119 dummy : ARRAY [0..5] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 120 BEGIN 121 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 122 StrEdit.Append( LocalStr, ': ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 123 StrConv.IntegerToStr(TheInt, 0, dummy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 124 StrEdit.Append( LocalStr, dummy ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 125 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 126 END diagI; ***** ^ not supported yet 127 128 129 PROCEDURE diagL(str1 : ARRAY OF CHAR; TheLong : LONGINT); ***** ^ not supported yet 130 VAR 131 LocalStr: ARRAY [0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 132 KeyHit: CARDINAL; 133 dummy : ARRAY [0..15] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 134 BEGIN 135 M2Strings.Assign( str1, LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 136 StrEdit.Append( LocalStr, ': ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 137 StrConv.LongIntegerToStr(TheLong, 0, dummy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 138 StrEdit.Append( LocalStr, dummy ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 139 ErrorManager.WARN( LocalStr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 140 END diagL; ***** ^ not supported yet 141 142 143 PROCEDURE diagBlock( str1 : ARRAY OF CHAR; TheAddr : SYSTEM.ADDRESS; ***** ^ not supported yet ***** ^ not supported yet 144 TheSize: CARDINAL ); 145 VAR 146 fhandle: CARDINAL; 147 tmpstr: ARRAY [0..15] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 148 BEGIN 149 HandleIO.OpenForAppending( 'tmp.txt', fhandle ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 150 StrConv.CardinalToStr( TheSize, 0, tmpstr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 151 StringIO.WriteEol( fhandle, '' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 152 StringIO.WriteStr( fhandle, str1 ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 153 StringIO.WriteStr( fhandle, '; ' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 154 StringIO.WriteStr( fhandle, tmpstr ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 155 StringIO.WriteEol( fhandle, ' bytes:' ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 156 IF 0 # HandleIO.BlockWrite( fhandle, TheAddr, TheSize ) THEN END; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 157 IF 0 # HandleIO.CloseHandle( fhandle ) THEN END; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 158 END diagBlock; ***** ^ not supported yet 159 160 161 PROCEDURE CheckList( TheList: GenLists.GenList ); ***** ^ not supported yet 162 VAR 163 DataSize, TotalElems, TotalSize: LONGINT; 164 TotalSubs: CARDINAL; 165 BEGIN 166 (* 167 DataSize := Storage.MemoryInUse; 168 TotalSize := Storage.MaxMemoryUsed; 169 *) 170 DataSize := GenLists.ListSize( TheList, TotalElems, ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 171 TotalSubs, TotalSize ); ***** ^ not supported yet 172 END CheckList; ***** ^ not supported yet 173 174 BEGIN 175 Initialized := FALSE; 176 Init(); ***** ^ not supported yet ***** ^ not supported yet 177 END Diagnostics. ***** ^ not supported yet 231 errors