DIRECTORY RefID USING [ID], Rope USING [ROPE], SRPCCalls USING [ Error, GetSHandle, NewRPCConversation, SHandle, TimeoutEnable ], SunRPC USING [Handle], Thrush, ThrushSunRPC, ThrushSunRPCConvert, ThSmarts, ThSmartsRpcControl USING [InterfaceRecord, InterfaceRecordObject], ThSmartsSunImport, ThSmartsSunRPC, ThSmartsSunRPCClient ; ThSmartsToThSmartsSunRPC: CEDAR PROGRAM IMPORTS SRPCCalls, ThSmartsSunRPCClient, ThrushSunRPCConvert EXPORTS ThSmartsSunImport ~ { OPEN ThrushSunRPCConvert; InterfaceRecord: TYPE ~ ThSmartsRpcControl.InterfaceRecord; SHHH: TYPE ~ Thrush.SHHH; sunSHHH: CARD32 = 0; Error: PUBLIC ERROR[errCode: ATOM, explanation: Rope.ROPE] ~ CODE; Progress: PROC[ interface: InterfaceRecord, shh: Thrush.SHHH, convEvent: Thrush.ConvEvent ] = { ENABLE SRPCCalls.Error => Error[errCode, explanation]; ThSmartsSunRPCClient.Progress[h: GetHandle[shh], shh: sunSHHH, convEvent: ConvEventToSr[convEvent]]; }; ReportAction: PROC[ interface: InterfaceRecord, shh: Thrush.SHHH, report: Thrush.ActionReport ] = { ENABLE SRPCCalls.Error => Error[errCode, explanation]; ThSmartsSunRPCClient.ReportAction[h: GetHandle[shh], shh: sunSHHH, report: ActionReportToSr[report]]; }; Substitution: PROC[ interface: InterfaceRecord, shh: Thrush.SHHH, convEvent: Thrush.ConvEvent, oldPartyID: Thrush.PartyID, newPartyID: Thrush.PartyID ] = { ENABLE SRPCCalls.Error => Error[errCode, explanation]; ThSmartsSunRPCClient.Substitution[h: GetHandle[shh], shh: sunSHHH, convEvent: ConvEventToSr[convEvent], oldPartyID: oldPartyID, newPartyID: newPartyID]; }; CheckIn: PROC[ interface: InterfaceRecord, shh: Thrush.SHHH, credentials: Thrush.Credentials, voicePath: BOOL _ TRUE, reason: Thrush.Reason, remark: Thrush.ROPE_NIL, nextScheduledCheck: INT ] = { ENABLE SRPCCalls.Error => Error[errCode, explanation]; ThSmartsSunRPCClient.CheckIn[h: GetHandle[shh], shh: sunSHHH, credentials: CredentialsToSr[credentials], voicePath: voicePath, reason: ATOMToSr[reason], remark: ROPEToSr[remark], nextScheduledCheck: nextScheduledCheck]; }; GetHandle: PROC [shhh: Thrush.SHHH] RETURNS [h: SunRPC.Handle_NIL] = { sHandle: SRPCCalls.SHandle _ SRPCCalls.GetSHandle[shhh]; IF sHandle#NIL THEN h _ sHandle.handle; }; sunPgm: CARD _ 390910; -- decimal program number for ThSmarts sunPgmVersion: CARD _ 1; sunCallTimeout: INT _ 3000; sunCallRetries: INT _ 3; sunCallTimeoutEnable: SRPCCalls.TimeoutEnable _ always; ImportInterface: PUBLIC PROC [instance: Rope.ROPE, reportProblem: ThSmartsSunImport.ReportProblem_NIL, reportData: REF_NIL] RETURNS [interface: InterfaceRecord, shhh: SHHH] ~ { shhh _ SRPCCalls.NewRPCConversation[serverName: instance, rpcProgram: sunPgm, rpcVersion: sunPgmVersion, timeoutEnable: sunCallTimeoutEnable, timeoutInMs: sunCallTimeout, retries: sunCallRetries]; SRPCCalls.GetSHandle[shhh].enabled _ TRUE; interface _ NEW[ThSmartsRpcControl.InterfaceRecordObject]; interface^ _ [clientStubProgress: Progress, clientStubReportAction: ReportAction, clientStubSubstitution: Substitution, clientStubCheckIn: CheckIn]; }; }. . ThSmartsToThSmartsSunRPC.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. Pier, May 24, 1990 12:50:16 pm PDT Polle Zellweger (PTZ) October 29, 1990 5:04:22 pm PST Swinehart, September 19, 1990 7:09:19 am PDT ThSmarts is a voice service interface. It is exported to $recording service parties to provide access to procedures for recording and playing voice, and for VoiceRope editing activities. This version uses Pup RPC interface records (ThSmartsRPCControl.InterfaceRecord) and maintains a separate RefTab for associating Sun RPC handles with the interface records. It differs from the other Sun stubs in two ways: first, the voice server (rather than the workstation) is the RPC client, and second, there are multiple instances of ThSmarts interfaces -- and there can even be multiple instances on the same workstation (i.e., FinchSmarts and MacawSmarts). Types Handles Connecting instance (address) should look like "sun#[1.2.3.4]#567", where [1.2.3.4] is the Arpa address, and 567 is the port. Report stuff not implemented yet, if ever. Polle Zellweger (PTZ) June 25, 1990 11:59:18 am PDT Add import routines to create new interface records. changes to: SunHandleTable, GetHandle, SunProtocol, SunAddrFromRope, ImportInterface Polle Zellweger (PTZ) August 13, 1990 2:07:40 pm PDT Move SunProtocol, SunAddrFromRope to VoiceUtilsImpl (export to VoiceUtilsExtras) changes to: DIRECTORY, ThSmartsToThSmartsSunRPC, ImportInterface Swinehart, September 15, 1990 2:36:09 pm PDT Change to track SRPCCalls and other related changes. Error management is not as elaborate on this side: ThParty implementation simply zaps clients whenever any communication error occurs; clients are expected to jump through hoops to recover (and do!). Unlike ThParty stuboid, these procedures simply pass on errors to the caller, as errors. They do remap to an Error at this level, so that the clients don't need to know about any other interface. Polle Zellweger (PTZ) October 29, 1990 5:04:09 pm PST Allow detection of NIL ropes across a SunRPC connection. changes to: CheckIn Κ*•NewlineDelimiter ™šœ™Icode™Jšœžœ˜Jšœžœ˜Jšœžœ˜J˜7K˜K™rK™š œžœžœžœ1žœžœžœ˜{KšΟtœ*€™,Kšžœ$žœ˜4KšœΔ˜ΔKšœ%žœ˜*Kšœ žœ+˜:Kšœ”˜”K˜——J™Jšœ˜™3K™4Kšœ ΟrH™T—™4Kšœ₯œ/™PKšœ Πkr ₯+™@—™,K™ύK™Δ—™5K™8Kšœ ₯™—K™—…— Ψ0