ThSmartsSunRPCServerStub.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Derived from ThSmartsP910V1ServerImpl.mesa
Generated by Pier.pa at May 18, 1990 5:59:48 pm PDT
using Sirocco [2.0] of February 10, 1989 6:26:26 pm PST
Polle Zellweger (PTZ) August 13, 1990 2:14:24 pm PDT
Swinehart, September 17, 1990 2:46:29 pm PDT
DIRECTORY
SRPCCalls USING [ ExportSunRPCInterface ],
SunRPC,
ThrushSunRPC,
ThSmartsSunExport,
ThSmartsSunRPC,
ThSmartsSunRPCServer;
ThSmartsSunRPCServerStub: CEDAR PROGRAM
IMPORTS SRPCCalls, SunRPC, ThSmartsSunRPCServer
EXPORTS ThSmartsSunExport
~ {
OPEN ThSmartsSunRPC, ThSmartsSunRPCServer;
Handle: TYPE ~ SunRPC.Handle;
SubstitutionCaller: PROC [h: SunRPC.Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
convEvent: ThrushSunRPC.ConvEvent;
oldPartyID: CARD32;
newPartyID: CARD32;
{
shh ¬ SunRPC.GetCard32[h];
};
{
convEvent.self.partyID ¬ SunRPC.GetCard32[h];
convEvent.self.smartsID ¬ SunRPC.GetCard32[h];
convEvent.self.convID ¬ SunRPC.GetCard32[h];
convEvent.self.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
convEvent.self.stateID ¬ SunRPC.GetCard32[h];
convEvent.other.partyID ¬ SunRPC.GetCard32[h];
convEvent.other.smartsID ¬ SunRPC.GetCard32[h];
convEvent.other.convID ¬ SunRPC.GetCard32[h];
convEvent.other.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
convEvent.other.stateID ¬ SunRPC.GetCard32[h];
convEvent.time ¬ SunRPC.GetCard32[h];
convEvent.reason ¬ SunRPC.GetRope[h];
convEvent.comment ¬ SunRPC.GetRope[h];
};
{
oldPartyID ¬ SunRPC.GetCard32[h];
};
{
newPartyID ¬ SunRPC.GetCard32[h];
};
[] ¬ Substitution[h, shh, convEvent, oldPartyID, newPartyID];
beginReturn[h];
};
ReportActionCaller: PROC [h: SunRPC.Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
report: ThrushSunRPC.ActionReport;
{
shh ¬ SunRPC.GetCard32[h];
};
{
report.self.partyID ¬ SunRPC.GetCard32[h];
report.self.smartsID ¬ SunRPC.GetCard32[h];
report.self.convID ¬ SunRPC.GetCard32[h];
report.self.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
report.self.stateID ¬ SunRPC.GetCard32[h];
report.other.partyID ¬ SunRPC.GetCard32[h];
report.other.smartsID ¬ SunRPC.GetCard32[h];
report.other.convID ¬ SunRPC.GetCard32[h];
report.other.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
report.other.stateID ¬ SunRPC.GetCard32[h];
report.requestingParty ¬ SunRPC.GetCard32[h];
report.actionID ¬ SunRPC.GetCard32[h];
report.actionClass ¬ SunRPC.GetRope[h];
report.actionType ¬ SunRPC.GetRope[h];
report.actionInfo ¬ SunRPC.GetRope[h];
};
[] ¬ ReportAction[h, shh, report];
beginReturn[h];
};
CheckInCaller: PROC [h: SunRPC.Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
credentials: ThrushSunRPC.Credentials;
voicePath: BOOLEAN;
reason: ROPE;
remark: ROPE;
nextScheduledCheck: INT32;
{
shh ¬ SunRPC.GetCard32[h];
};
{
credentials.partyID ¬ SunRPC.GetCard32[h];
credentials.smartsID ¬ SunRPC.GetCard32[h];
credentials.convID ¬ SunRPC.GetCard32[h];
credentials.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
credentials.stateID ¬ SunRPC.GetCard32[h];
};
{
voicePath ¬ SunRPCGetBool[h];
};
{
reason ¬ SunRPC.GetRope[h];
};
{
remark ¬ SunRPC.GetRope[h];
};
{
nextScheduledCheck ¬ SunRPC.GetInt32[h];
};
[] ¬ CheckIn[h, shh, credentials, voicePath, reason, remark, nextScheduledCheck];
beginReturn[h];
};
ProgressCaller: PROC [h: SunRPC.Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shh: CARD32;
convEvent: ThrushSunRPC.ConvEvent;
{
shh ¬ SunRPC.GetCard32[h];
};
{
convEvent.self.partyID ¬ SunRPC.GetCard32[h];
convEvent.self.smartsID ¬ SunRPC.GetCard32[h];
convEvent.self.convID ¬ SunRPC.GetCard32[h];
convEvent.self.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
convEvent.self.stateID ¬ SunRPC.GetCard32[h];
convEvent.other.partyID ¬ SunRPC.GetCard32[h];
convEvent.other.smartsID ¬ SunRPC.GetCard32[h];
convEvent.other.convID ¬ SunRPC.GetCard32[h];
convEvent.other.state ¬ VAL[CARDINAL[SunRPC.GetCard32[h]]];
convEvent.other.stateID ¬ SunRPC.GetCard32[h];
convEvent.time ¬ SunRPC.GetCard32[h];
convEvent.reason ¬ SunRPC.GetRope[h];
convEvent.comment ¬ SunRPC.GetRope[h];
};
[] ¬ Progress[h, shh, convEvent];
beginReturn[h];
};
SunRPCBeginReturnProc: TYPE ~ PROC [h: Handle];
Server: SunRPC.ServerProc ~ {
[h: Handle, c: Conversation, proc: CARD, clientData: REF] RETURNS [doReply: BOOL, replyTimeToLive: CARDINAL]
ENABLE {
};
beginReturn: SunRPCBeginReturnProc ~ {
SunRPC.StartReply[h];
SunRPC.PutRope[h, NIL]; -- no error
SunRPC.PutRope[h, NIL]; -- no explanation
No errors in VoiceRopeServer interface.
};
doReply ¬ TRUE;
replyTimeToLive ¬ 2;
SELECT proc FROM
3 => SubstitutionCaller[h, beginReturn];
2 => ReportActionCaller[h, beginReturn];
4 => CheckInCaller[h, beginReturn];
1 => ProgressCaller[h, beginReturn];
ENDCASE => {
ERROR SunRPC.Error[$wrongProc];
};
};
SunRPCGetBool: PROC [h: Handle] RETURNS [BOOL] ~ INLINE {
RETURN [SunRPC.GetCard32[h] # 0] };
SunRPCPutBool: PROC [h: Handle, bool: BOOL] ~ INLINE {
SunRPC.PutCard32[h, IF bool THEN 1 ELSE 0] };
Initialize server
sunPgm: CARD ¬ 390910; -- decimal program number
sunPgmVersion: CARD ¬ 1;
ExportInterface: PUBLIC PROC [port: CARD¬0] RETURNS [uniquePort: CARD] ~ {
uniquePort ¬ SRPCCalls.ExportSunRPCInterface[port, Server, sunPgm, sunPgmVersion];
};
}...
Polle Zellweger (PTZ) May 23, 1990 6:53:02 pm PDT
Change Get/PutCard16 to Get/PutCard32, because the former are not aligned on the wire. Change VAL[CARD32] to VAL[CARDINAL[CARD32]].
Polle Zellweger (PTZ) June 26, 1990 11:19:13 am PDT
Create procedure for server registration, because it must be done for different instances of ThSmarts on workstation. Add CardTab.
changes to: ExportInterface, RopeFromSunAddr, GetServer, SunServerTable
Polle Zellweger (PTZ) July 31, 1990 1:01:22 pm PDT
Always pass nullPort to SunRPC.CreateServer.
changes to: ExportInterface
Polle Zellweger (PTZ) August 13, 1990 2:12:59 pm PDT
Move RopeFromSunAddr to VoiceUtilsImpl (export to VoiceUtilsExtras)