-- Copyright (C) 1987 by Xerox Corporation. All rights reserved. -- Stub file was translated on July 1, 1987 12:22:22 pm PDT by Lupine of January 22, 1987 5:37:32 pm PST -- Source interface FootballMaster came from file FootballMaster.bcd, which was created on July 1, 1987 11:37:35 am PDT with version stamp 270#174#3762546063 from source of May 1, 1984 9:48:34 pm PDT. -- The RPC stub modules for FootballMaster are: -- FootballMasterRpcControl.mesa; -- FootballMasterRpcClientImpl.mesa; -- FootballMasterRpcBinderImpl.mesa; -- FootballMasterRpcServerImpl.mesa. -- The parameters for this translation are: -- Target language = Cedar -- Default parameter passing = VALUE -- Deallocate server heap arguments = TRUE -- Inline RpcServerImpl dispatcher stubs = TRUE -- Declare signals = TRUE -- Warn about short POINTER ("MDS") allocations = TRUE -- Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50 -- Acceptable parameter protocols = VersionRange[1..1]. DIRECTORY FootballMaster, FootballMasterRpcControl USING [InterfaceRecord, InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC --USING SOME OF [InterfaceName, standardZones, Zones]--, RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher, -- GetPkt, GetStubPkt, ImportHandle, ImportInterface, ImportInterfaceWithHost, -- maxDataLength, maxPrincipalLength, maxShortStringLength, noHost, -- pktOverhead, ReceiveExtraPkt, RPCHost, SendPrelimPkt, StartCall, -- StartSignal, StubPkt, UnimportInterface]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError, -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT, -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError, -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, PrincOpsUtils --USING SOME OF [Enter, Exit]--, Rope --USING SOME OF [InlineFlatten, Length, NewText, Text]--, VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber, -- PageNumberForAddress, PagesForWords]--; FootballMasterRpcClientImpl: MONITOR IMPORTS RpcPrivate: RPCLupine, Lupine: LupineRuntime, Atom, PrincOpsUtils, Rope EXPORTS FootballMaster, FootballMasterRpcControl SHARES FootballMaster, FootballMasterRpcControl, Rope = BEGIN OPEN FootballMaster, RpcControl: FootballMasterRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN ← FALSE; myInterface: RpcPrivate.ImportHandle; paramZones: RpcPublic.Zones ← RpcPublic.standardZones; ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, parameterStorage: RpcPublic.Zones, hostHint: RpcPrivate.RPCHost←RpcPrivate.noHost ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; myInterface ← RpcPrivate.ImportInterfaceWithHost [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "FootballMaster~270#174#3762546063", instance: interfaceName.instance, version: interfaceName.version ], localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion, hostHint: hostHint ]; paramZones ← [ gc: IF parameterStorage.gc # NIL THEN parameterStorage.gc ELSE Lupine.defaultZones.gc, heap: IF parameterStorage.heap # NIL THEN parameterStorage.heap ELSE Lupine.defaultZones.heap, mds: IF parameterStorage.mds # NIL THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ]; bound ← TRUE; END; UnimportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface ← RpcPrivate.UnimportInterface[myInterface]; paramZones ← RpcPublic.standardZones; bound ← FALSE; END; -- Remote public procedure stubs. SetCommands: PUBLIC PROCEDURE [team: Team, c: Commands] RETURNS [anonP1id3642080: GameRec] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SetCommands, team (1): Team, c (2): Commands]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id3642080 (0): GameRec]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+145]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 38; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+145]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team, c: c]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 145, signalHandler: ClientDispatcher]; [anonP1id3642080: anonP1id3642080] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 145]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+145]; RETURN[anonP1id3642080]; END; -- UNWIND. END; -- SetCommands. KickOff: PUBLIC PROCEDURE [team: Team] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← KickOff, team (1): Team]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- KickOff. SetUp: PUBLIC PROCEDURE [team: Team] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SetUp, team (1): Team]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SetUp. Hike: PUBLIC PROCEDURE [team: Team] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← Hike, team (1): Team]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- Hike. TimeOut: PUBLIC PROCEDURE [team: Team] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← TimeOut, team (1): Team]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- TimeOut. PenaltyResponse: PUBLIC PROCEDURE [team: Team, accepted: BOOLEAN] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← PenaltyResponse, team (1): Team, accepted (2): BOOLEAN]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+3] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 3; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [team: team, accepted: accepted]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- PenaltyResponse. DisableDelayOfGame: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← DisableDelayOfGame]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← DisableDelayOfGame; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- DisableDelayOfGame. -- Remote public signals and errors. StupidFuckingWarnings: PUBLIC SIGNAL [itsGottaHaveAGoddamName: ATOM] = CODE; -- Public signal and error dispatcher. ClientDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN SELECT LOOPHOLE[pkt.data[0], RpcControl.SignalIndex] FROM StupidFuckingWarnings => RETURN[ StupidFuckingWarningsStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt, localConversation: localConversation]]; ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ClientDispatcher -- Public signal and error dispatcher stubs. StupidFuckingWarningsStub: --SIGNAL [itsGottaHaveAGoddamName: ATOM]-- RpcPrivate.Dispatcher = INLINE BEGIN itsGottaHaveAGoddamName: ATOM; pktLength: RpcPrivate.DataLength ← 1; BEGIN -- Unmarshal itsGottaHaveAGoddamName: ATOM from pkt.data[pktLength]. pNameOfAtom: Rope.ROPE; ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL ← pkt.data[pktLength]; pktLength ← pktLength+1; IF ropeIsNIL THEN pNameOfAtom ← NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength ← pkt.data[pktLength]; pktLength ← pktLength+1; IF ropeLength > LAST[NAT] THEN Lupine.UnmarshalingError; pNameOfAtom ← textRope ← Rope.NewText[size: ropeLength]; pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. itsGottaHaveAGoddamName ← IF pNameOfAtom = NIL THEN NIL ELSE Atom.MakeAtom[--pName:-- pNameOfAtom]; END; -- Unmarshal itsGottaHaveAGoddamName. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; SIGNAL StupidFuckingWarnings[itsGottaHaveAGoddamName]; pktLength ← 0; RETURN[returnLength: pktLength]; END; -- StupidFuckingWarningsStub. -- No module initialization. END. -- FootballMasterRpcClientImpl.