InbasketP18V2AuxImpl.mesa
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
DIRECTORY
Convert,
Rope,
InbasketP18V2,
AuthenticationP14V2Aux,
InbasketP18V2Aux;
InbasketP18V2AuxImpl: CEDAR PROGRAM
IMPORTS Convert, Rope, AuthenticationP14V2Aux
EXPORTS InbasketP18V2Aux ~ {
OPEN InbasketP18V2, InbasketP18V2Aux;
ROPE: TYPE ~ Rope.ROPE;
ExposeAccessProblem: PUBLIC PROC [arg: AccessProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
accessRightsInsufficient => res ¬ "accessRightsInsufficient";
accessRightsIndeterminate => res ¬ "accessRightsIndeterminate";
noSuchInbasket => res ¬ "noSuchInbasket";
inbasketIndeterminate => res ¬ "inbasketIndeterminate";
wrongService => res ¬ "wrongService";
ENDCASE => ERROR
};
ExposeServiceProblem: PUBLIC PROC [arg: ServiceProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
cannotAuthenticate => res ¬ "cannotAuthenticate";
serviceFull => res ¬ "serviceFull";
serviceUnavailable => res ¬ "serviceUnavailable";
ENDCASE => ERROR
};
ExposeTwo: PUBLIC PROC [arg: Two, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
FOR i: CARDINAL IN [0..2) DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg[i]]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeSessionProblem: PUBLIC PROC [arg: SessionProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
tokenInvalid => res ¬ "tokenInvalid";
ENDCASE => ERROR
};
ExposeStatus: PUBLIC PROC [arg: Status, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "messageStatus~", ExposeMessageStatus[arg.messageStatus, (level+1)], ", "];
res ¬ Rope.Cat[res, "bodyPartsStatus~", ExposeBodyPartsStatus[arg.bodyPartsStatus, (level+1)], "]"];
};
ExposeIndexProblem: PUBLIC PROC [arg: IndexProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
invalidIndex => res ¬ "invalidIndex";
invalidBodyPartIndex => res ¬ "invalidBodyPartIndex";
ENDCASE => ERROR
};
ExposeSession: PUBLIC PROC [arg: Session, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "token~", ExposeTwo[arg.token, (level+1)], ", "];
res ¬ Rope.Cat[res, "verifier~", AuthenticationP14V2Aux.ExposeSeqWords[arg.verifier, (level+1)], "]"];
};
ExposeBodyPartSequence: PUBLIC PROC [arg: BodyPartSequence, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
FOR i: CARDINAL IN [0..arg.length) DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg.body[i]]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeOtherProblem: PUBLIC PROC [arg: OtherProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
cantExpedite => res ¬ "cantExpedite";
malformedMessage => res ¬ "malformedMessage";
invalidOperation => res ¬ "invalidOperation";
last => res ¬ "last";
ENDCASE => ERROR
};
ExposeAnchor: PUBLIC PROC [arg: Anchor, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
FOR i: CARDINAL IN [0..5) DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromCard[arg[i]]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeBodyPartsStatus: PUBLIC PROC [arg: BodyPartsStatus, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
FOR i: CARDINAL IN [0..arg.length) DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, Convert.RopeFromBool[arg.body[i]]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
ExposeExist: PUBLIC PROC [arg: Exist, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
new => res ¬ "new";
known => res ¬ "known";
ENDCASE => ERROR
};
ExposeRange: PUBLIC PROC [arg: Range, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "low~", Convert.RopeFromCard[arg.low], ", "];
res ¬ Rope.Cat[res, "high~", Convert.RopeFromCard[arg.high], "]"];
};
ExposeDel: PUBLIC PROC [arg: Del, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
true => res ¬ "true";
noChange => res ¬ "noChange";
ENDCASE => ERROR
};
ExposeMessageStatus: PUBLIC PROC [arg: MessageStatus, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "userDefinedStatus~", Convert.RopeFromCard[arg.userDefinedStatus], ", "];
res ¬ Rope.Cat[res, "existenceOfMessage~", ExposeExist[arg.existenceOfMessage, (level+1)], "]"];
};
ExposeState: PUBLIC PROC [arg: State, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "new~", Convert.RopeFromCard[arg.new], ", "];
res ¬ Rope.Cat[res, "total~", Convert.RopeFromCard[arg.total], "]"];
};
ExposeTransferProblem: PUBLIC PROC [arg: TransferProblem, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
aborted => res ¬ "aborted";
ENDCASE => ERROR
};
ExposeBodyPartStatusChange: PUBLIC PROC [arg: BodyPartStatusChange, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
res ¬ Rope.Cat[res, "bodyPartIndex~", Convert.RopeFromCard[arg.bodyPartIndex], ", "];
res ¬ Rope.Cat[res, "deleteable~", ExposeDel[arg.deleteable, (level+1)], "]"];
};
ExposeWhichOne: PUBLIC PROC [arg: WhichOne, level: NAT] RETURNS [res: ROPE] ~ {
SELECT arg FROM
this => res ¬ "this";
next => res ¬ "next";
ENDCASE => ERROR
};
ExposeBodyPartStatusChangeSequence: PUBLIC PROC [arg: BodyPartStatusChangeSequence, level: NAT] RETURNS [res: ROPE] ~ {
res ¬ "[";
FOR i: CARDINAL IN [0..arg.length) DO
res ¬ Rope.Cat[res, IF i>0 THEN ", " ELSE NIL, ExposeBodyPartStatusChange[arg.body[i], (level+1)]];
ENDLOOP;
res ¬ Rope.Concat[res, "]"];
};
}...