DEADSOFTWARE

6282f4e4acd3bc1ab45cf0a56c6cb24f3877e948
[dsw-obn.git] / rtl / Oberon.obn
1 MODULE Oberon;
3 IMPORT Args, Texts, Out;
5 TYPE
6 ParList* = POINTER TO ParRec;
7 ParRec* = RECORD
8 text*: Texts.Text;
9 pos*: LONGINT
10 END;
12 VAR
13 Log*: Texts.Text;
14 Par*: ParList;
16 R: Texts.Reader;
17 W: Texts.Writer;
19 (*
20 PROCEDURE GetClock* (VAR t, d: LONGINT);
22 PROCEDURE Time* (): LONGINT;
23 *)
25 PROCEDURE PopulateParams;
26 VAR W: Texts.Writer; i: INTEGER; str: ARRAY 256 OF CHAR;
27 BEGIN
28 Texts.OpenWriter(W);
29 i := 1;
30 WHILE i < Args.count DO
31 Args.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " ");
32 INC(i)
33 END;
34 Texts.Append(Par.text, W.buf);
35 END PopulateParams;
37 PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT);
38 BEGIN text := NIL; beg := 0; end := 0; time := 0
39 END GetSelection;
41 (* --- Notifier for echoing to the comsole all text appended to the log. --- *)
42 PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT);
43 VAR ch: CHAR;
44 BEGIN
45 Texts.OpenReader(R, Log, beg);
46 WHILE ~R.eot & (beg < end) DO
47 Texts.Read(R, ch);
48 IF ch = 0DX THEN Out.Ln ELSE Out.Char(ch) END;
49 INC(beg)
50 END
51 END LogNotifier;
53 PROCEDURE StubNotifier(T: Texts.Text; op: INTEGER; beg, end: LONGINT);
54 BEGIN
55 END StubNotifier;
57 BEGIN
58 NEW(Par);
59 NEW(Par.text);
60 Par.text.notify := StubNotifier;
61 Par.pos := 0;
62 Texts.Open(Par.text, "");
63 PopulateParams;
64 NEW(Log);
65 Texts.Open(Log, "");
66 Log.notify := LogNotifier;
67 END Oberon.