1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE ../shared/a_modes.inc}
17 {$R-}
18 { $DEFINE CBLOG}
21 interface
23 uses
24 SysUtils;
26 type
32 procedure e_WriteLog (TextLine: String; RecordCategory: TRecordCategory; WriteTime: Boolean=True);
36 // start Write/WriteLn driver. it will write everything to cbuf.
40 var
44 implementation
46 uses
47 conbuf;
50 var
57 begin
58 Result := Format('%d.%d.%d.%d', [ip and $FF, (ip shr 8) and $FF, (ip shr 16) and $FF, (ip shr 24)]);
62 procedure e_WriteLog (TextLine: String; RecordCategory: TRecordCategory; WriteTime: Boolean=True);
63 var
67 begin
69 begin
80 try
83 else
85 try
87 begin
98 else
103 finally
112 begin
115 begin
116 try
125 // ////////////////////////////////////////////////////////////////////////// //
126 (* Write/WriteLn driver *)
127 //
128 // control codes:
129 // CR, LF, BS
130 // TAB: tab space = 4
131 //
132 // userData[1]: current x (for tabs)
133 // userData[2]: #13 was eaten, we should skip next #10
134 //
135 type
138 const
144 var
149 begin
153 begin
154 // look for some special char
158 begin
163 {$IFDEF CBLOG}
165 {$ENDIF}
168 begin
174 continue;
176 // process special chars
180 // tab
182 begin
183 {$IFDEF CBLOG}
185 {$ENDIF}
186 repeat
190 continue;
192 // cr, lf
194 begin
195 {$IFDEF CBLOG}
197 {$ENDIF}
199 begin
204 continue;
213 begin
222 var
225 begin
235 begin
240 begin
246 begin
248 begin
251 begin
254 begin
269 begin
270 //e_InitWritelnDriver();