VoiceRopeServerSunRPCServerStub.mesa
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Derived from VoiceRopeServerP912V1ServerImpl.mesa
Generated by PolleZ.pa at May 16, 1990 3:45:53 pm PDT
using Sirocco [2.0] of February 10, 1989 6:26:26 pm PST
Swinehart, September 17, 1990 2:44:39 pm PDT
Polle Zellweger, December 27, 1990 6:31 pm PST
DIRECTORY
SRPCCalls USING [ ExportSunRPCInterface ],
SunRPC,
ThrushSunRPC,
VoiceRopeServerSunExport,
VoiceRopeServerSunRPC,
VoiceRopeServerSunRPCServer
;
VoiceRopeServerSunRPCServerStub: CEDAR PROGRAM
IMPORTS SRPCCalls, SunRPC, VoiceRopeServerSunRPCServer
EXPORTS VoiceRopeServerSunExport ~ {
OPEN VoiceRopeServerSunRPC, VoiceRopeServerSunRPCServer;
Types
Handle: TYPE ~ SunRPC.Handle;
ForgetCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
class: ROPE;
refID: ROPE;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
class ← SunRPC.GetRope[h];
};
{
refID ← SunRPC.GetRope[h];
};
[nb] ← Forget[h, shhh, vr, class, refID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
PlayCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
voiceRope: VoiceRope;
credentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
intID: CARD32;
queueIt: BOOLEAN;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
voiceRope.ropeID ← SunRPC.GetRope[h];
voiceRope.start ← SunRPC.GetInt32[h];
voiceRope.length ← SunRPC.GetInt32[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];
};
{
intID ← SunRPC.GetCard32[h];
};
{
queueIt ← SunRPCGetBool[h];
};
[nb] ← Play[h, shhh, voiceRope, credentials, serviceID, intID, queueIt];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
RecordCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
recordedParty: CARD32;
intID: CARD32;
queueIt: BOOLEAN;
nb: ROPE;
voiceRope: VoiceRope;
{
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];
};
{
recordedParty ← SunRPC.GetCard32[h];
};
{
intID ← SunRPC.GetCard32[h];
};
{
queueIt ← SunRPCGetBool[h];
};
[nb, voiceRope] ← Record[h, shhh, credentials, serviceID, recordedParty, intID, queueIt];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, voiceRope.ropeID];
SunRPC.PutInt32[h, voiceRope.start];
SunRPC.PutInt32[h, voiceRope.length];
};
};
CatCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
callerRName: ROPE;
vr1: VoiceRope;
vr2: VoiceRope;
vr3: VoiceRope;
vr4: VoiceRope;
vr5: VoiceRope;
nb: ROPE;
new: VoiceRope;
{
shhh ← SunRPC.GetCard32[h];
};
{
callerRName ← SunRPC.GetRope[h];
};
{
vr1.ropeID ← SunRPC.GetRope[h];
vr1.start ← SunRPC.GetInt32[h];
vr1.length ← SunRPC.GetInt32[h];
};
{
vr2.ropeID ← SunRPC.GetRope[h];
vr2.start ← SunRPC.GetInt32[h];
vr2.length ← SunRPC.GetInt32[h];
};
{
vr3.ropeID ← SunRPC.GetRope[h];
vr3.start ← SunRPC.GetInt32[h];
vr3.length ← SunRPC.GetInt32[h];
};
{
vr4.ropeID ← SunRPC.GetRope[h];
vr4.start ← SunRPC.GetInt32[h];
vr4.length ← SunRPC.GetInt32[h];
};
{
vr5.ropeID ← SunRPC.GetRope[h];
vr5.start ← SunRPC.GetInt32[h];
vr5.length ← SunRPC.GetInt32[h];
};
[nb, new] ← Cat[h, shhh, callerRName, vr1, vr2, vr3, vr4, vr5];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, new.ropeID];
SunRPC.PutInt32[h, new.start];
SunRPC.PutInt32[h, new.length];
};
};
StopCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
creentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
creentials.partyID ← SunRPC.GetCard32[h];
creentials.smartsID ← SunRPC.GetCard32[h];
creentials.convID ← SunRPC.GetCard32[h];
creentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
creentials.stateID ← SunRPC.GetCard32[h];
};
{
serviceID ← SunRPC.GetCard32[h];
};
[nb] ← Stop[h, shhh, creentials, serviceID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
SubstrCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
callerRName: ROPE;
vr: VoiceRope;
start: INT32;
len: INT32;
nb: ROPE;
new: VoiceRope;
{
shhh ← SunRPC.GetCard32[h];
};
{
callerRName ← SunRPC.GetRope[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
start ← SunRPC.GetInt32[h];
};
{
len ← SunRPC.GetInt32[h];
};
[nb, new] ← Substr[h, shhh, callerRName, vr, start, len];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, new.ropeID];
SunRPC.PutInt32[h, new.start];
SunRPC.PutInt32[h, new.length];
};
};
ReplaceCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
callerRName: ROPE;
vr: VoiceRope;
start: INT32;
len: INT32;
with: VoiceRope;
nb: ROPE;
new: VoiceRope;
{
shhh ← SunRPC.GetCard32[h];
};
{
callerRName ← SunRPC.GetRope[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
start ← SunRPC.GetInt32[h];
};
{
len ← SunRPC.GetInt32[h];
};
{
with.ropeID ← SunRPC.GetRope[h];
with.start ← SunRPC.GetInt32[h];
with.length ← SunRPC.GetInt32[h];
};
[nb, new] ← Replace[h, shhh, callerRName, vr, start, len, with];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, new.ropeID];
SunRPC.PutInt32[h, new.start];
SunRPC.PutInt32[h, new.length];
};
};
DescribeRopeCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
minSilence: INT32;
nb: ROPE;
length: INT32;
noise: IntervalSpecs;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
minSilence ← SunRPC.GetInt32[h];
};
[nb, length, noise] ← DescribeRope[h, shhh, vr, minSilence];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutInt32[h, length];
};
{
MProc18[h, noise];
};
};
SetPermissionsCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
callerRName: ROPE;
vr: VoiceRope;
playAccess: Users;
editAccess: Users;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
callerRName ← SunRPC.GetRope[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
playAccess ← UProc19[h];
};
{
editAccess ← UProc19[h];
};
[nb] ← SetPermissions[h, shhh, callerRName, vr, playAccess, editAccess];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
PauseCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
cedentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
cedentials.partyID ← SunRPC.GetCard32[h];
cedentials.smartsID ← SunRPC.GetCard32[h];
cedentials.convID ← SunRPC.GetCard32[h];
cedentials.state ← VAL[CARDINAL[SunRPC.GetCard32[h]]];
cedentials.stateID ← SunRPC.GetCard32[h];
};
{
serviceID ← SunRPC.GetCard32[h];
};
[nb] ← Pause[h, shhh, cedentials, serviceID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
ResumeCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
credentials: ThrushSunRPC.Credentials;
serviceID: CARD32;
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];
};
[nb] ← Resume[h, shhh, credentials, serviceID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
GetEnergiesCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
samplesPerSegment: CARD16;
nb: ROPE;
energies: EnergySequence;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
samplesPerSegment ← SunRPC.GetCard32[h];
};
[nb, energies] ← GetEnergies[h, shhh, vr, samplesPerSegment];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
MProc20[h, energies];
};
};
GetPermissionsCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
nb: ROPE;
playAccess: Users;
editAccess: Users;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
[nb, playAccess, editAccess] ← GetPermissions[h, shhh, vr];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
MProc21[h, playAccess];
};
{
MProc21[h, editAccess];
};
};
LengthCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
nb: ROPE;
len: INT32;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
[nb, len] ← Length[h, shhh, vr];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutInt32[h, len];
};
};
GetByInterestCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
class: ROPE;
refID: ROPE;
nb: ROPE;
voiceRope: VoiceRope;
{
shhh ← SunRPC.GetCard32[h];
};
{
class ← SunRPC.GetRope[h];
};
{
refID ← SunRPC.GetRope[h];
};
[nb, voiceRope] ← GetByInterest[h, shhh, class, refID];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, voiceRope.ropeID];
SunRPC.PutInt32[h, voiceRope.start];
SunRPC.PutInt32[h, voiceRope.length];
};
};
StoreBlockCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
block: VoiceBlock;
key: ThrushSunRPC.Key;
nb: ROPE;
voiceRope: VoiceRope;
{
shhh ← SunRPC.GetCard32[h];
};
{
block ← UProc22[h];
};
{
FOR i23: CARDINAL IN [0..3) DO
key[i23] ← SunRPC.GetCard32[h];
ENDLOOP;
};
[nb, voiceRope] ← StoreBlock[h, shhh, block, key];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
SunRPC.PutRope[h, voiceRope.ropeID];
SunRPC.PutInt32[h, voiceRope.start];
SunRPC.PutInt32[h, voiceRope.length];
};
};
RetainCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
callerRName: ROPE;
vr: VoiceRope;
class: ROPE;
refID: ROPE;
other: ROPE;
nb: ROPE;
{
shhh ← SunRPC.GetCard32[h];
};
{
callerRName ← SunRPC.GetRope[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
class ← SunRPC.GetRope[h];
};
{
refID ← SunRPC.GetRope[h];
};
{
other ← SunRPC.GetRope[h];
};
[nb] ← Retain[h, shhh, callerRName, vr, class, refID, other];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
};
FetchBlockCaller: PROC [h: Handle, beginReturn: SunRPCBeginReturnProc] ~ {
shhh: CARD32;
vr: VoiceRope;
start: INT32;
len: INT32;
decrypt: BOOLEAN;
nb: ROPE;
block: VoiceBlock;
{
shhh ← SunRPC.GetCard32[h];
};
{
vr.ropeID ← SunRPC.GetRope[h];
vr.start ← SunRPC.GetInt32[h];
vr.length ← SunRPC.GetInt32[h];
};
{
start ← SunRPC.GetInt32[h];
};
{
len ← SunRPC.GetInt32[h];
};
{
decrypt ← SunRPCGetBool[h];
};
[nb, block] ← FetchBlock[h, shhh, vr, start, len, decrypt];
beginReturn[h];
{
SunRPC.PutRope[h, nb];
};
{
MProc24[h, block];
};
};
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
7 => ForgetCaller[h, beginReturn];
2 => PlayCaller[h, beginReturn];
1 => RecordCaller[h, beginReturn];
9 => CatCaller[h, beginReturn];
3 => StopCaller[h, beginReturn];
10 => SubstrCaller[h, beginReturn];
11 => ReplaceCaller[h, beginReturn];
13 => DescribeRopeCaller[h, beginReturn];
17 => SetPermissionsCaller[h, beginReturn];
4 => PauseCaller[h, beginReturn];
5 => ResumeCaller[h, beginReturn];
14 => GetEnergiesCaller[h, beginReturn];
18 => GetPermissionsCaller[h, beginReturn];
12 => LengthCaller[h, beginReturn];
8 => GetByInterestCaller[h, beginReturn];
16 => StoreBlockCaller[h, beginReturn];
6 => RetainCaller[h, beginReturn];
15 => FetchBlockCaller[h, beginReturn];
ENDCASE => ERROR SunRPC.Error[$wrongProc];
EXITS
Finished => { NULL };
};
Unmarshal / Marshal Procs --
SunRPCGetBool: PROC [h: SunRPC.Handle] RETURNS [BOOL] ~ INLINE {
RETURN [SunRPC.GetCard32[h] # 0] };
SunRPCPutBool: PROC [h: SunRPC.Handle, bool: BOOL] ~ INLINE {
SunRPC.PutCard32[h, IF bool THEN 1 ELSE 0] };
MProc21: PROC [h: Handle, val: Users] ~ {
SunRPC.PutCard32[h, val.length];
FOR i25: CARDINAL IN [0..val.length) DO
SunRPC.PutRope[h, val.body[i25]];
ENDLOOP;
};
MProc18: PROC [h: Handle, val: IntervalSpecs] ~ {
SunRPC.PutCard32[h, val.length];
FOR i26: CARDINAL IN [0..val.length) DO
SunRPC.PutInt32[h, val.body[i26].start];
SunRPC.PutInt32[h, val.body[i26].length];
ENDLOOP;
};
MProc20: PROC [h: Handle, val: EnergySequence] ~ {
SunRPC.PutCard32[h, val.length];
FOR i27: CARDINAL IN [0..val.length) DO
SunRPC.PutCard32[h, val.body[i27]];
ENDLOOP;
};
MProc24: PROC [h: Handle, val: VoiceBlock] ~ {
SunRPC.PutCard32[h, val.length];
FOR i28: CARDINAL IN [0..val.length) DO
SunRPC.PutCard32[h, val.body[i28]];
ENDLOOP;
};
UProc19: PROC [h: Handle] RETURNS [res: Users] ~ {
{
length30: CARDINAL ~ SunRPC.GetCard32[h];
res ← NEW[UsersObject[length30]];
FOR i29: CARDINAL IN [0..length30) DO
res.body[i29] ← SunRPC.GetRope[h];
ENDLOOP;
};
};
UProc22: PROC [h: Handle] RETURNS [res: VoiceBlock] ~ {
{
length32: CARDINAL ~ SunRPC.GetCard32[h];
res ← NEW[VoiceBlockObject[length32]];
FOR i31: CARDINAL IN [0..length32) DO
res.body[i31] ← SunRPC.GetCard32[h];
ENDLOOP;
};
};
Initialize server
sunPgm: CARD ← 390912; -- 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 16, 1990 6:09:39 pm PDT
Created.
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, December 27, 1990 6:15:26 pm PST
Manually added callerRName field to operations that need to know the caller's name.
changes to: RetainCaller, CatCaller, SubstrCaller, ReplaceCaller, SetPermissionsCaller