Commander.mesa;
Last Modified by McGregor on 7-Dec-81 10:53:03
Last Modified On March 22, 1983 12:25 pm By Paul Rovner
Last Modified On April 6, 1983 5:12 pm By L. Stewart
DIRECTORY
IO USING [STREAM],
List USING [AList],
Rope USING [ROPE];
Commander: CEDAR DEFINITIONS = BEGIN
Handle: TYPE = REF CommandObject;
CommandProc: TYPE = PROC [cmd: Handle];
CommandObject: TYPE = RECORD [
in, out, err: IO.STREAM,
commandLine: Rope.ROPE,
commandLine is the command line with the first "token" (as defined by IO.GetCedarToken) removed; commandLine ends with CR
command: Rope.ROPE,
The first token on the command line, used as a key to select this CommandProc.
propertyList: List.AList
Name value pair, yet unspecified.
];
Register: PROC[key: Rope.ROPE, proc: CommandProc, doc: Rope.ROPE];
Enumerate: PROC[PROC[name: Rope.ROPE, proc: CommandProc, doc: Rope.ROPE] RETURNS[stop: BOOL]] RETURNS [
name: Rope.ROPE --NIL if not stopped--,
proc: CommandProc,
doc: Rope.ROPE
];
Lookup: PROC[key: Rope.ROPE] RETURNS [proc: CommandProc, doc: Rope.ROPE];
The following procedures are useful for manipulating propertyLists.
PutProperty is like List.PutAssoc, except that it works correctly if the key is a ROPE.
PutProperty: PUBLIC PROCEDURE [key: REF ANY, val: REF ANY, aList: List.AList] RETURNS [List.AList];
GetProperty is like List.Assoc, except that it works correctly if the key is a ROPE.
GetProperty: PROCEDURE [key: REF ANY, aList: List.AList] RETURNS [val: REF ANY];
A ProcCell is common coinage, if anyone should wish to deal in REF CommandProcs, they should deal in REF ProcCells instead.
ProcCell: TYPE = RECORD [
proc: Commander.CommandProc,
doc: Rope.ROPE
];
END.