-- SortDirDefs.mesa
-- Last Edited by: Sweet, October 8, 1984 11:04:47 am PDT
DIRECTORY
Basics,
Containers,
IO,
Rope,
ViewerClasses;
SortDirDefs: DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
CallerNumber: TYPE = [0..200);
CP: TYPE = RECORD [name, phone: ROPE, recruiter: CallerNumber];
CallerNameRec: TYPE = ARRAY CallerNumber OF CP;
Handle: TYPE = REF MyRec; -- a REF to the data for a particular instance of the sample tool; multiple instances can be created.
MyRec: TYPE = RECORD [ -- the data for a particular tool instance
outer: Containers.Container ← NIL, -- handle for the enclosing container
height: CARDINAL ← 0,  -- height measured from the top of the container
cmd: CommandViewer,  -- the commands
in, in2: IO.STREAM, eof: BOOLEANFALSE,
out: IO.STREAM,
item: EntrySeq,
secondary: EntrySeq,
callerNumber, recruiterNumber: REF BOOL,
address, zip, level, activity, dinner, age, phone, caller, recruiter, member: REF BOOL,
tsIn, tsOut: STREAM,
callerName: REF CallerNameRec,
dinnerOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
levelOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
activityOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
ageOrder: PACKED ARRAY CHAR OF [0..16) ← ALL[0],
ts: ViewerClasses.Viewer ];  -- the typescript
Entry: TYPE = RECORD [
caller: CallerNumber ← 0,
activity, level, dinner, age: CHAR ← ' ,
phone: ARRAY [0..4) OF ROPEALL[NIL],
name: ARRAY [0..4) OF ROPEALL[NIL],
addr: ARRAY [0..4) OF ROPEALL[NIL],
town: ROPENIL,
zip: ROPENIL,
mailing: ROPENIL,
comment: ROPENIL,
extracted for use by sort comparison
cname: ROPE, -- cannonical form name
street: ROPE,
number: INT ← 0,
ctown: ROPE];
EntrySeqBody: TYPE = RECORD [count: CARDINAL ← 0, e: SEQUENCE max: CARDINAL OF REF Entry];
EntrySeq: TYPE = REF EntrySeqBody;
CommandViewer: TYPE = RECORD [
inputFile, outputFile, secondary, callers: ViewerClasses.Viewer
];
CompareProc: PROC [h: Handle, r1, r2: REF Entry] RETURNS [Basics.Comparison];
Quit: PROC [handle: Handle, reason: ROPENIL];
Quit2: PROC [handle: Handle, st: IO.STREAM, reason: ROPENIL];
}.