summaryrefslogtreecommitdiff
path: root/system/multiuser/1.7.5/src/multi user monitor
blob: dd3051eda6762a33f23d25cc98947b78413463b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
(* ------------------- VERSION 2      16.05.86 ------------------- *)
PACKET multi user monitor DEFINES              (* Autor: J.Liedtke *)

    monitor :
 
 
LET command list =
 
"edit:1.01run:4.01runagain:6.0insert:7.01forget:9.01rename:11.2copy:12.2
list:13.0storageinfo:14.0taskinfo:15.0
fetch:16.1save:17.01break:19.0saveall:20.0 " ;

LET text param type = 4 ;

 
INT VAR command index , number of params , previous heap size ;
TEXT VAR param 1, param 2 ;
 
 
  lernsequenz auf taste legen ("q", ""1""8""1""12"break"13"") ;
  lernsequenz auf taste legen ("e", ""1""8""1""12"edit"13"") ;


PROC monitor :
 
  disable stop ;
  previous heap size := heap size ;
  REP 
    command dialogue (TRUE) ;
    sysin ("") ;
    sysout ("") ;
    cry if not enough storage ;
    get command ("gib kommando :") ;
    reset editor ;
    analyze command (command list, text param type,
                     command index, number of params, param1, param2) ;
    execute command ;
    collect heap garbage if necessary
  PER .
 
collect heap garbage if necessary :
  IF heap size > previous heap size + 10
    THEN collect heap garbage ;
         previous heap size := heap size
  FI .

cry if not enough storage :
  INT VAR size, used ;
  storage (size, used) ;
  IF used > size
    THEN out (""7"Speicher Engpass! Dateien loeschen!"13""10"")
  FI .

reset editor :
  WHILE aktueller editor > 0 REP
    quit
  PER ;
  clear error .

ENDPROC monitor ;

PROC execute command :

  enable stop ;
  SELECT command index OF
    CASE 1 : edit
    CASE 2 : edit (param1)
    CASE 3 : (* war frueher paralleleditor *)
    CASE 4 : run
    CASE 5 : run (param1)
    CASE 6 : run again
    CASE 7 : insert
    CASE 8 : insert (param1)
    CASE 9 : forget
    CASE 10: forget (param1)
    CASE 11: rename (param1, param2)
    CASE 12: copy (param1, param2)
    CASE 13: list
    CASE 14: storage info
    CASE 15: task info
    CASE 16: fetch (param1)
    CASE 17: save
    CASE 18: save (param1)
    CASE 19: break
    CASE 20: save all

    OTHERWISE do command
  ENDSELECT .
 
ENDPROC  execute command ;
 
ENDPACKET multi user monitor ;