SynthesizerServerSunRPCServerStub.mesa
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Derived from SynthesizerServerP911V1ServerImpl.mesa
Generated by Pier.pa at May 18, 1990 4:51:07 pm PDT
using Sirocco [2.0] of February 10, 1989 6:26:26 pm PST
Polle Zellweger (PTZ) May 23, 1990 6:57:42 pm PDT
Swinehart, September 18, 1990 8:04:01 am PDT
DIRECTORY
SRPCCalls USING [ ExportSunRPCInterface ],
SunRPC,
ThrushSunRPC,
SynthesizerServerSunRPC,
SynthesizerServerSunExport,
SynthesizerServerSunRPCServer;
SynthesizerServerSunRPCServerStub: CEDAR PROGRAM
IMPORTS SRPCCalls, SunRPC, SynthesizerServerSunRPCServer
EXPORTS SynthesizerServerSunExport ~ {
OPEN SynthesizerServerSunRPC, SynthesizerServerSunRPCServer;
Handle: TYPE = SunRPC.Handle;
GetSynthesizerSpecificationsCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
serviceID: CARD32;
nb: ROPE;
synthesizerModel: ROPE;
synthesizerVersion: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
serviceID ← SunRPC.GetCard32[h];
};
[nb, synthesizerModel, synthesizerVersion] ← GetSynthesizerSpecifications[h, shhh, serviceID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, synthesizerModel];
};
{
SunRPC.PutRope[h, synthesizerVersion];
};
};
StopSpeechCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
reset: BOOLEAN;
nb: ROPE;
{
shhh ← 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];
};
{
serviceID ← SunRPC.GetCard32[h];
};
{
reset ← SunRPCGetBool[h];
};
[nb] ← StopSpeech[h, shhh, credentials, serviceID, reset];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
TextToSpeechCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
textToSpeak: ROPE;
actionID: CARD32;
filter: BOOLEAN;
queueIt: BOOLEAN;
nb: ROPE;
{
shhh ← 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];
};
{
serviceID ← SunRPC.GetCard32[h];
};
{
textToSpeak ← SunRPC.GetRope[h];
};
{
actionID ← SunRPC.GetCard32[h];
};
{
filter ← SunRPCGetBool[h];
};
{
queueIt ← SunRPCGetBool[h];
};
[nb] ← TextToSpeech[h, shhh, credentials, serviceID, textToSpeak, actionID, filter, queueIt];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
SunRPCBeginReturnProc: TYPE ~ PROC [h: Handle];
Server: SunRPC.ServerProc ~ {
ENABLE {
};
beginReturn: SunRPCBeginReturnProc ~ {
SunRPC.StartReply[h];
};
doReply ← TRUE;
replyTimeToLive ← 2;
SELECT proc FROM
3 => GetSynthesizerSpecificationsCaller[h, beginReturn];
2 => StopSpeechCaller[h, beginReturn];
1 => TextToSpeechCaller[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 ← 390911; -- decimal program number
sunPgmVersion: CARD ← 1;
ExportInterface: PUBLIC PROC [port: CARD𡤀] 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]].