1Pedit: module 2{ 3 PATH: con "/dis/disk/pedit.dis"; 4 5 Part: adt { 6 name: string; 7 ctlname: string; 8 start: big; 9 end: big; 10 ctlstart: big; 11 ctlend: big; 12 changed: int; 13 tag: int; 14 }; 15 16 Maxpart: con 32; 17 18 Edit: adt { 19 disk: ref Disks->Disk; 20 21 ctlpart: array of ref Part; 22 part: array of ref Part; 23 24 # to do: replace by channels 25 add: ref fn(e: ref Edit, s: string, a, b: big): string; 26 del: ref fn(e: ref Edit, p: ref Part): string; 27 ext: ref fn(e: ref Edit, f: array of string): string; 28 help: ref fn(e: ref Edit): string; 29 okname: ref fn(e: ref Edit, s: string): string; 30 sum: ref fn(e: ref Edit, p: ref Part, a, b: big); 31 write: ref fn(e: ref Edit): string; 32 printctl: ref fn(e: ref Edit, x: ref Sys->FD); 33 34 unit: string; 35 dot: big; 36 end: big; 37 38 # do not use fields below this line 39 changed: int; 40 warned: int; 41 lastcmd: int; 42 43 mk: fn(unit: string): ref Edit; 44 getline: fn(e: self ref Edit): string; 45 runcmd: fn(e: self ref Edit, c: string); 46 findpart: fn(e: self ref Edit, n: string): ref Part; 47 addpart: fn(e: self ref Edit, p: ref Part): string; 48 delpart: fn(e: self ref Edit, p: ref Part): string; 49 ctldiff: fn(e: self ref Edit, ctlfd: ref Sys->FD): int; 50 }; 51 52 init: fn(); 53}; 54