InbasketP18V2ClientImpl.mesa
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
DIRECTORY
CrRPC,
CHNameP2V0,
AuthenticationP14V2,
MailTransportP17V5,
BulkDataP0V1,
InbasketP18V2;
InbasketP18V2ClientImpl: CEDAR PROGRAM
IMPORTS CrRPC
EXPORTS InbasketP18V2 ~ {
OPEN InbasketP18V2;
TransferError: PUBLIC TransferErrorType ~ CODE;
IndexError: PUBLIC IndexErrorType ~ CODE;
ServiceError: PUBLIC ServiceErrorType ~ CODE;
InbasketInUse: PUBLIC InbasketInUseType ~ CODE;
SessionError: PUBLIC SessionErrorType ~ CODE;
OtherError: PUBLIC OtherErrorType ~ CODE;
AuthenticationError: PUBLIC AuthenticationErrorType ~ CODE;
AccessError: PUBLIC AccessErrorType ~ CODE;
GetError: CrRPC.GetErrorProc ~ {
SELECT errNum FROM
7 => {
problem: TransferProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR TransferError[problem]
};
9 => {
problem: IndexProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR IndexError[problem]
};
6 => {
problem: ServiceProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR ServiceError[problem]
};
10 => {
user: CHNameP2V0.ThreePartName;
user.organization ¬ CrRPC.GetRope[s];
user.domain ¬ CrRPC.GetRope[s];
user.object ¬ CrRPC.GetRope[s];
ERROR InbasketInUse[user]
};
5 => {
problem: SessionProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR SessionError[problem]
};
8 => {
problem: OtherProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR OtherError[problem]
};
1 => {
problem: AuthenticationP14V2.Problem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR AuthenticationError[problem]
};
0 => {
problem: AccessProblem;
problem ¬ VAL[CrRPC.GetCard16[s]];
ERROR AccessError[problem]
};
ENDCASE => {
ERROR CrRPC.Error[h, remoteError, "Unexpected Remote Error"];
};
};
GetSize: PUBLIC GetSizeType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutRope[s, inbasket.organization];
CrRPC.PutRope[s, inbasket.domain];
CrRPC.PutRope[s, inbasket.object];
CrRPC.PutCard16[s, ORD[credentials.type]];
MProc1[h, s, credentials.value];
MProc1[h, s, verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
sizeInBytes ¬ CrRPC.GetCard32[s];
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~10 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Logoff: PUBLIC LogoffType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
FOR i2: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i2]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~4 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Logon: PUBLIC LogonType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutRope[s, inbasket.organization];
CrRPC.PutRope[s, inbasket.domain];
CrRPC.PutRope[s, inbasket.object];
CrRPC.PutCard16[s, ORD[credentials.type]];
MProc1[h, s, credentials.value];
MProc1[h, s, verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
FOR i3: CARDINAL IN [0..2) DO
session.token[i3] ¬ CrRPC.GetCard16[s];
ENDLOOP;
session.verifier ¬ UProc4[h, s];
state.new ¬ CrRPC.GetCard16[s];
state.total ¬ CrRPC.GetCard16[s];
FOR i5: CARDINAL IN [0..5) DO
anchor[i5] ¬ CrRPC.GetCard16[s];
ENDLOOP;
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~5 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
Delete: PUBLIC DeleteType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, range.low];
CrRPC.PutCard32[s, range.high];
FOR i6: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i6]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~1 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
ChangeMessageStatus: PUBLIC ChangeMessageStatusType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, range.low];
CrRPC.PutCard32[s, range.high];
CrRPC.PutBool[s, changeUserDefinedStatus];
CrRPC.PutCard16[s, newUserDefinedStatus];
FOR i7: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i7]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~0 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
RetrieveBodyParts: PUBLIC RetrieveBodyPartsType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, message];
MProc8[h, s, bodyParts];
CrRPC.PutBulkDataSink[h, s, contents];
FOR i9: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i9]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
NULL
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~8 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
MailPoll: PUBLIC MailPollType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutRope[s, inbasket.organization];
CrRPC.PutRope[s, inbasket.domain];
CrRPC.PutRope[s, inbasket.object];
CrRPC.PutCard16[s, ORD[credentials.type]];
MProc1[h, s, credentials.value];
MProc1[h, s, verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
state.new ¬ CrRPC.GetCard16[s];
state.total ¬ CrRPC.GetCard16[s];
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~7 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
ChangeBodyPartsStatus: PUBLIC ChangeBodyPartsStatusType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, index];
MProc10[h, s, setStatusTo];
FOR i11: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i11]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
deleted ¬ CrRPC.GetBool[s];
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~3 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
RetrieveEnvelopes: PUBLIC RetrieveEnvelopesType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
CrRPC.PutCard32[s, last];
CrRPC.PutCard16[s, ORD[whichMsg]];
FOR i12: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i12]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
transportEnvelope ¬ UProc13[h, s];
status.messageStatus.userDefinedStatus ¬ CrRPC.GetCard16[s];
status.messageStatus.existenceOfMessage ¬ VAL[CrRPC.GetCard16[s]];
status.bodyPartsStatus ¬ UProc14[h, s];
next ¬ CrRPC.GetCard32[s];
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~2 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
MailCheck: PUBLIC MailCheckType ~ {
PutArgs: CrRPC.PutArgsProc ~ {
FOR i15: CARDINAL IN [0..2) DO
CrRPC.PutCard16[s, session.token[i15]];
ENDLOOP;
MProc1[h, s, session.verifier];
};
GetResults: CrRPC.GetResultsProc ~ {
state.new ¬ CrRPC.GetCard16[s];
state.total ¬ CrRPC.GetCard16[s];
};
CrRPC.Call[h~h, remotePgm~18, remotePgmVersion~2, remoteProc~6 , putArgs~PutArgs, getResults~GetResults, getError~GetError];
};
MProc1: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: AuthenticationP14V2.SeqWords] ~ {
CrRPC.PutCard16[s, val.length];
FOR i16: CARDINAL IN [0..val.length) DO
CrRPC.PutCard16[s, val.body[i16]];
ENDLOOP;
};
UProc4: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: AuthenticationP14V2.SeqWords] ~ {
{
length18: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[AuthenticationP14V2.SeqWordsObject[length18]];
FOR i17: CARDINAL IN [0..length18) DO
res.body[i17] ¬ CrRPC.GetCard16[s];
ENDLOOP;
};
};
UProc13: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.Envelope] ~ {
{
length20: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[MailTransportP17V5.EnvelopeObject[length20]];
FOR i19: CARDINAL IN [0..length20) DO
res.body[i19].type ¬ CrRPC.GetCard32[s];
res.body[i19].value ¬ UProc21[h, s];
ENDLOOP;
};
};
MProc8: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: BodyPartSequence] ~ {
CrRPC.PutCard16[s, val.length];
FOR i22: CARDINAL IN [0..val.length) DO
CrRPC.PutCard16[s, val.body[i22]];
ENDLOOP;
};
UProc14: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: BodyPartsStatus] ~ {
{
length24: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[BodyPartsStatusObject[length24]];
FOR i23: CARDINAL IN [0..length24) DO
res.body[i23] ¬ CrRPC.GetBool[s];
ENDLOOP;
};
};
MProc10: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: BodyPartStatusChangeSequence] ~ {
CrRPC.PutCard16[s, val.length];
FOR i25: CARDINAL IN [0..val.length) DO
CrRPC.PutCard16[s, val.body[i25].bodyPartIndex];
CrRPC.PutCard16[s, ORD[val.body[i25].deleteable]];
ENDLOOP;
};
UProc21: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: MailTransportP17V5.Opaque] ~ {
{
length27: CARDINAL ~ CrRPC.GetCard16[s];
res ¬ NEW[MailTransportP17V5.OpaqueObject[length27]];
FOR i26: CARDINAL IN [0..length27) DO
res.body[i26] ¬ CrRPC.GetCard16[s];
ENDLOOP;
};
};
}...