DIRECTORY Atom USING [GetPName, MakeAtom], BasicTime USING [ GMT ], IV USING [KeyTableBody], LoganBerry USING [ Attribute ], Pup USING [ Address ], RefID USING [ ID ], Rope USING [ Equal, InlineIsEmpty, ROPE ], RPC USING [ InterfaceName, VersionRange ], ThParty, ThPartySunRPC, Thrush, ThrushSunRPC, ThrushSunRPCConvert, VoiceRopeServer, VoiceRopeServerSunRPC ; ThrushSunRPCConvertImpl: CEDAR PROGRAM IMPORTS Atom, Rope, ThrushSunRPCConvert EXPORTS ThrushSunRPCConvert ~ { SrToAccessList: PUBLIC PROC [srAccessList: ThPartySunRPC.AccessList] RETURNS [accessList: ThParty.AccessList_NIL] ~ { FOR i: CARDINAL DECREASING IN [0..srAccessList.length) DO accessList _ CONS[SrToROPE[srAccessList[i]], accessList ]; ENDLOOP; }; AccessListToSr: PUBLIC PROC [accessList: ThParty.AccessList] RETURNS [srAccessList: ThPartySunRPC.AccessList] ~ { count: CARDINAL _ 0; FOR a: ThParty.AccessList _ accessList, a.rest WHILE a # NIL DO count _ count + 1; ENDLOOP; srAccessList _ NEW[ThPartySunRPC.AccessListObject[count]]; count _ 0; FOR a: ThParty.AccessList _ accessList, a.rest WHILE a # NIL DO srAccessList[count] _ ROPEToSr[a.first]; count _ count + 1; ENDLOOP; }; SrToActionReport: PUBLIC PROC [srActionReport: ThrushSunRPC.ActionReport] RETURNS [actionReport: Thrush.ActionReport] ~ { actionReport.self _ SrToCredentials[srActionReport.self]; actionReport.other _ SrToCredentials[srActionReport.other]; actionReport.requestingParty _ srActionReport.requestingParty; actionReport.actionID _ srActionReport.actionID; actionReport.actionClass _ SrToATOM[srActionReport.actionClass]; actionReport.actionType _ SrToATOM[srActionReport.actionType]; actionReport.actionInfo _ SrToROPE[srActionReport.actionInfo]; }; ActionReportToSr: PUBLIC PROC [actionReport: Thrush.ActionReport] RETURNS [srActionReport: ThrushSunRPC.ActionReport] ~ { srActionReport.self _ CredentialsToSr[actionReport.self]; srActionReport.other _ CredentialsToSr[actionReport.other]; srActionReport.requestingParty _ actionReport.requestingParty; srActionReport.actionID _ actionReport.actionID; srActionReport.actionClass _ ATOMToSr[actionReport.actionClass]; srActionReport.actionType _ ATOMToSr[actionReport.actionType]; srActionReport.actionInfo _ ROPEToSr[actionReport.actionInfo]; }; SrToAddress: PUBLIC PROC [srAddress: ThrushSunRPC.Address] RETURNS [address: Thrush.NetAddress] ~ { address.net _ [srAddress.net.net]; address.host _ [srAddress.host.host]; address.socket.a _ srAddress.socket.a; address.socket.b _ srAddress.socket.b; address.socket.c _ srAddress.socket.c; address.socket.d _ srAddress.socket.d; }; AddressToSr: PUBLIC PROC [address: Pup.Address] RETURNS [srAddress: ThrushSunRPC.Address] ~ { srAddress.net.net _ address.net; -- remove records from Thrush.cr def? srAddress.host.host _ address.host; srAddress.socket.a _ address.socket.a; srAddress.socket.b _ address.socket.b; srAddress.socket.c _ address.socket.c; srAddress.socket.d _ address.socket.d; }; SrToATOM: PUBLIC PROC [srAtom: Rope.ROPE] RETURNS [atom: ATOM] ~ { atom _ IF Rope.InlineIsEmpty[srAtom] THEN NIL ELSE Atom.MakeAtom[srAtom]; }; ATOMToSr: PUBLIC PROC [atom: ATOM] RETURNS [srAtom: Rope.ROPE] ~ { srAtom _ IF atom=NIL THEN NIL ELSE Atom.GetPName[atom]; }; SrToAttributes: PUBLIC PROC [srAttributes: ThPartySunRPC.Attributes] RETURNS [attributes: ThParty.Attributes_NIL] ~ { FOR i: CARDINAL DECREASING IN [0..srAttributes.length) DO attr: LoganBerry.Attribute _ [SrToATOM[srAttributes[i].type], srAttributes[i].value]; attributes _ CONS[attr, attributes]; ENDLOOP; }; AttributesToSr: PUBLIC PROC [attributes: ThParty.Attributes] RETURNS [srAttributes: ThPartySunRPC.Attributes] ~ { count: CARDINAL _ 0; FOR a: ThParty.Attributes _ attributes, a.rest WHILE a # NIL DO count _ count + 1; ENDLOOP; srAttributes _ NEW[ThPartySunRPC.EntryObject[count]]; count _ 0; FOR a: ThParty.Attributes _ attributes, a.rest WHILE a # NIL DO srAttributes[count].type _ ATOMToSr[a.first.type]; srAttributes[count].value _ a.first.value; count _ count + 1; ENDLOOP; }; SrToCandidateList: PUBLIC PROC [srCandidates: ThPartySunRPC.CandidateList] RETURNS [candidates: LIST OF ThParty.ConversationInfo_NIL] ~ { FOR i: CARDINAL DECREASING IN [0..srCandidates.length) DO cInfo: ThParty.ConversationInfo _ SrToConversationInfo[srCandidates[i]]; candidates _ CONS[cInfo, candidates]; ENDLOOP; }; CandidateListToSr: PUBLIC PROC [candidates: LIST OF ThParty.ConversationInfo] RETURNS [srCandidates: ThPartySunRPC.CandidateList] ~ { count: CARDINAL _ 0; FOR a: LIST OF ThParty.ConversationInfo _ candidates, a.rest WHILE a # NIL DO count _ count + 1; ENDLOOP; srCandidates _ NEW[ThPartySunRPC.CandidateListObject[count]]; count _ 0; FOR a: LIST OF ThParty.ConversationInfo _ candidates, a.rest WHILE a # NIL DO srCandidates[count] _ ConversationInfoToSr[a.first]; count _ count + 1; ENDLOOP; }; SrToConvEvent: PUBLIC PROC [srConvEvent: ThrushSunRPC.ConvEvent] RETURNS [convEvent: Thrush.ConvEvent_NIL] ~ { IF srConvEvent.reason = ATOMToSr[$sunRPCContainerReallyNIL] THEN RETURN; convEvent _ NEW[Thrush.ConvEventBody _ [ self: SrToCredentials[srConvEvent.self], other: SrToCredentials[srConvEvent.other], time: ThrushSunRPCConvert.SrToGMT[srConvEvent.time], reason: SrToATOM[srConvEvent.reason], comment: SrToROPE[srConvEvent.comment] ] ]; }; ConvEventToSr: PUBLIC PROC [convEvent: Thrush.ConvEvent] RETURNS [srConvEvent: ThrushSunRPC.ConvEvent] ~ { IF convEvent=NIL THEN convEvent _ NEW[Thrush.ConvEventBody _ [reason: $sunRPCContainerReallyNIL]]; srConvEvent _ [ self: CredentialsToSr[convEvent.self], other: CredentialsToSr[convEvent.other], time: ThrushSunRPCConvert.GMTToSr[convEvent.time], reason: ATOMToSr[convEvent.reason], comment: ROPEToSr[convEvent.comment] ]; }; SrToConversationInfo: PUBLIC PROC [srCInfo: ThPartySunRPC.ConversationInfo] RETURNS [cInfo: ThParty.ConversationInfo_NIL] ~ { IF srCInfo.convType = sunRPCContainerReallyNIL THEN RETURN; cInfo _ NEW[ThParty.ConversationInfoRec _ SrToConversationInfoRec[srCInfo]]; }; ConversationInfoToSr: PUBLIC PROC [cInfo: ThParty.ConversationInfo] RETURNS [srCInfo: ThPartySunRPC.ConversationInfo] ~ { IF cInfo=NIL THEN cInfo _ NEW[ThParty.ConversationInfoRec]; srCInfo _ ConversationInfoRecToSr[cInfo^]; IF cInfo=NIL THEN srCInfo.convType _ sunRPCContainerReallyNIL; }; SrToConversationInfoRec: PUBLIC PROC [srCInfo: ThPartySunRPC.ConversationInfo] RETURNS [cInfoRec: ThParty.ConversationInfoRec] ~ { cInfoRec _ [ convID: ThrushSunRPCConvert.SrToConvID[srCInfo.convID], numParties: srCInfo.numParties, numActive: srCInfo.numActive, numIdle: srCInfo.numIdle, originator: srCInfo.originator, conferenceHost: SrToAddress[srCInfo.conferenceHost], convType: ThrushSunRPCConvert.SrToConvType[srCInfo.convType], bilateralConv: srCInfo.bilateralConv, startTime: ThrushSunRPCConvert.SrToGMT[srCInfo.startTime], convAttributes: SrToAttributes[srCInfo.convAttributes], moderator: srCInfo.moderator, commentator: srCInfo.commentator ]; }; ConversationInfoRecToSr: PUBLIC PROC [cInfoRec: ThParty.ConversationInfoRec] RETURNS [srCInfo: ThPartySunRPC.ConversationInfo] ~ { srCInfo _ [ convID: ThrushSunRPCConvert.ConvIDToSr[cInfoRec.convID], numParties: cInfoRec.numParties, numActive: cInfoRec.numActive, numIdle: cInfoRec.numIdle, originator: cInfoRec.originator, conferenceHost: AddressToSr[cInfoRec.conferenceHost], convType: ThrushSunRPCConvert.ConvTypeToSr[cInfoRec.convType], bilateralConv: cInfoRec.bilateralConv, startTime: ThrushSunRPCConvert.GMTToSr[cInfoRec.startTime], convAttributes: AttributesToSr[cInfoRec.convAttributes], moderator: cInfoRec.moderator, commentator: cInfoRec.commentator ]; }; SrToCredentials: PUBLIC PROC [srCredentials: ThrushSunRPC.Credentials] RETURNS [credentials: Thrush.Credentials] ~ { credentials _ [ partyID: srCredentials.partyID, smartsID: srCredentials.smartsID, convID: ThrushSunRPCConvert.SrToConvID[srCredentials.convID], state: ThrushSunRPCConvert.SrToState[srCredentials.state], stateID: NAT[srCredentials.stateID] ]; }; CredentialsToSr: PUBLIC PROC [credentials: Thrush.Credentials] RETURNS [srCredentials: ThrushSunRPC.Credentials] ~ { srCredentials _ [ partyID: credentials.partyID, smartsID: credentials.smartsID, convID: ThrushSunRPCConvert.ConvIDToSr[credentials.convID], state: ThrushSunRPCConvert.StateToSr[credentials.state], stateID: credentials.stateID ]; }; SrToEnergySequence: PUBLIC PROC [srEnergySequence: VoiceRopeServerSunRPC.EnergySequence] RETURNS [energySequence: VoiceRopeServer.EnergySequence_NIL] ~ { IF srEnergySequence.length=0 THEN RETURN; energySequence _ NEW[VoiceRopeServer.EnergySequenceRec[srEnergySequence.length]]; FOR i: CARDINAL DECREASING IN [0..srEnergySequence.length) DO energySequence[i] _ srEnergySequence[i]; ENDLOOP; }; EnergySequenceToSr: PUBLIC PROC [energySequence: VoiceRopeServer.EnergySequence] RETURNS [srEnergySequence: VoiceRopeServerSunRPC.EnergySequence] ~ { length: CARDINAL _ IF energySequence=NIL THEN 0 ELSE energySequence.length; srEnergySequence _ NEW[VoiceRopeServerSunRPC.EnergySequenceObject[length]]; FOR i: CARDINAL DECREASING IN [0..length) DO srEnergySequence[i] _ energySequence[i]; ENDLOOP; }; SrToInterfaceName: PUBLIC PROC [srInterface: ThrushSunRPC.InterfaceName] RETURNS [interface: RPC.InterfaceName] ~ { interface.type _ srInterface.type; interface.instance _ srInterface.instance; interface.version _ SrToVersionRange[srInterface.version]; }; InterfaceNameToSr: PUBLIC PROC [interface: RPC.InterfaceName] RETURNS [srInterface: ThrushSunRPC.InterfaceName] ~ { srInterface.type _ interface.type; srInterface.instance _ interface.instance; srInterface.version _ VersionRangeToSr[interface.version]; }; SrToInterfaceSpec: PUBLIC PROC [srInterfaceSpec: ThrushSunRPC.InterfaceSpec] RETURNS [interfaceSpec: Thrush.InterfaceSpec] ~ { interfaceSpec.interfaceName _ SrToInterfaceName[srInterfaceSpec.interfaceName]; interfaceSpec.hostHint _ SrToAddress[srInterfaceSpec.hostHint]; interfaceSpec.serviceID _ srInterfaceSpec.serviceID; interfaceSpec.interfaceID _ srInterfaceSpec.interfaceID; }; InterfaceSpecToSr: PUBLIC PROC [interfaceSpec: Thrush.InterfaceSpec] RETURNS [srInterfaceSpec: ThrushSunRPC.InterfaceSpec] ~ { srInterfaceSpec.interfaceName _ InterfaceNameToSr[interfaceSpec.interfaceName]; srInterfaceSpec.hostHint _ AddressToSr[interfaceSpec.hostHint]; srInterfaceSpec.serviceID _ interfaceSpec.serviceID; srInterfaceSpec.interfaceID _ interfaceSpec.interfaceID; }; SrToIntervalSpecs: PUBLIC PROC [srIntervalSpecs: VoiceRopeServerSunRPC.IntervalSpecs] RETURNS [intervalSpecs: VoiceRopeServer.IntervalSpecs_NIL] ~ { SrToInterval: PROC [sri: VoiceRopeServerSunRPC.Interval] RETURNS [vri: VoiceRopeServer.Interval] ~ { vri.start _ sri.start; vri.length _ sri.length; }; FOR i: CARDINAL DECREASING IN [0..srIntervalSpecs.length) DO intervalSpecs _ CONS[SrToInterval[srIntervalSpecs[i]], intervalSpecs]; ENDLOOP; }; IntervalSpecsToSr: PUBLIC PROC [intervalSpecs: VoiceRopeServer.IntervalSpecs] RETURNS [srIntervalSpecs: VoiceRopeServerSunRPC.IntervalSpecs] ~ { IntervalToSr: PROC [vri: VoiceRopeServer.Interval] RETURNS [sri: VoiceRopeServerSunRPC.Interval] ~ { sri.start _ vri.start; sri.length _ vri.length; }; count: CARDINAL _ 0; FOR a: VoiceRopeServer.IntervalSpecs _ intervalSpecs, a.rest WHILE a # NIL DO count _ count + 1; ENDLOOP; srIntervalSpecs _ NEW[VoiceRopeServerSunRPC.IntervalSpecsObject[count]]; count _ 0; FOR a: VoiceRopeServer.IntervalSpecs _ intervalSpecs, a.rest WHILE a # NIL DO srIntervalSpecs[count] _ IntervalToSr[a.first]; count _ count + 1; ENDLOOP; }; SrToKeyTable: PUBLIC PROC [srKeyTable: ThrushSunRPC.KeyTable] RETURNS [keyTable: Thrush.KeyTable_NIL] ~ { IF srKeyTable.s.length=0 THEN RETURN; keyTable _ NEW[ IV.KeyTableBody[srKeyTable.s.length] ]; FOR i: CARDINAL DECREASING IN [0..keyTable.size) DO keyTable[i] _ ThrushSunRPCConvert.SrToEncryptionKey[srKeyTable.s[i] ]; ENDLOOP; }; KeyTableToSr: PUBLIC PROC [keyTable: Thrush.KeyTable] RETURNS [srKeyTable: ThrushSunRPC.KeyTable] ~ { size: CARDINAL _ IF keyTable=NIL THEN 0 ELSE keyTable.size; srKeyTable.s _ NEW[ ThrushSunRPC.KeysObject[size] ]; FOR i: CARDINAL DECREASING IN [0..size) DO srKeyTable.s[i] _ ThrushSunRPCConvert.EncryptionKeyToSr[keyTable[i] ]; ENDLOOP; }; SrToPartyInfo: PUBLIC PROC [srPInfo: ThPartySunRPC.PartyInfo] RETURNS [pInfo: ThParty.PartyInfo_NIL] ~ { IF srPInfo.conversationInfo.convType = sunRPCContainerReallyNIL THEN RETURN; pInfo _ NEW[ ThParty.PartyInfoSeq[srPInfo.parties.length] ]; pInfo.numParties _ NAT[srPInfo.numParties]; pInfo.conversationInfo _ SrToConversationInfoRec[srPInfo.conversationInfo]; pInfo.ixSelf _ NAT[srPInfo.ixSelf]; pInfo.ixOther _ NAT[srPInfo.ixOther]; pInfo.ixModerator _ NAT[srPInfo.ixModerator]; pInfo.ixCommentator _ NAT[srPInfo.ixCommentator]; pInfo.ixCommSock _ NAT[srPInfo.ixCommSock]; pInfo.ixOriginator _ NAT[srPInfo.ixOriginator]; FOR i: NAT DECREASING IN [0..srPInfo.parties.length) DO pInfo.parties[i] _ SrToPartyInfoSpec[srPInfo.parties[i]]; ENDLOOP; }; PartyInfoToSr: PUBLIC PROC [pInfo: ThParty.PartyInfo] RETURNS [srPInfo: ThPartySunRPC.PartyInfo] ~ { IF pInfo=NIL THEN pInfo _ NEW[ThParty.PartyInfoSeq[0]]; srPInfo.numParties _ pInfo.numParties; srPInfo.conversationInfo _ ConversationInfoRecToSr[pInfo.conversationInfo]; srPInfo.ixSelf _ pInfo.ixSelf; srPInfo.ixOther _ pInfo.ixOther; srPInfo.ixModerator _ pInfo.ixModerator; srPInfo.ixCommentator _ pInfo.ixCommentator; srPInfo.ixCommSock _ pInfo.ixCommSock; srPInfo.ixOriginator _ pInfo.ixOriginator; srPInfo.parties _ NEW[ThPartySunRPC.PartyListObject[pInfo.len]]; FOR i: CARDINAL IN [0..pInfo.len) DO srPInfo.parties[i] _ PartyInfoSpecToSr[ pInfo.parties[i] ]; ENDLOOP; IF pInfo=NIL THEN srPInfo.conversationInfo.convType _ sunRPCContainerReallyNIL; }; SrToPartyInfoSpec: PUBLIC PROC [srPartySpec: ThPartySunRPC.PartyInfoSpec] RETURNS [partySpec: ThParty.PartyInfoSpec] ~ { partySpec.partyID _ srPartySpec.partyID; partySpec.name _ SrToROPE[srPartySpec.name]; partySpec.intendedPartyID _ srPartySpec.intendedPartyID; partySpec.intendedName _ SrToROPE[srPartySpec.intendedName]; partySpec.type _ SrToATOM[srPartySpec.type]; partySpec.state _ ThrushSunRPCConvert.SrToState[srPartySpec.state]; partySpec.numConvs _ srPartySpec.numConvs; partySpec.enabled _ srPartySpec.enabled; partySpec.voicePath _ srPartySpec.voicePath; partySpec.partyActive _ srPartySpec.partyActive; partySpec.partyEngaged _ srPartySpec.partyEngaged; partySpec.socket _ SrToAddress[srPartySpec.socket]; partySpec.partyAttributes _ SrToAttributes[srPartySpec.partyAttributes]; }; PartyInfoSpecToSr: PUBLIC PROC [partySpec: ThParty.PartyInfoSpec] RETURNS [srPartySpec: ThPartySunRPC.PartyInfoSpec] ~ { srPartySpec.partyID _ partySpec.partyID; srPartySpec.name _ ROPEToSr[partySpec.name]; srPartySpec.intendedPartyID _ partySpec.intendedPartyID; srPartySpec.intendedName _ ROPEToSr[partySpec.intendedName]; srPartySpec.type _ ATOMToSr[partySpec.type]; srPartySpec.state _ ThrushSunRPCConvert.StateToSr[partySpec.state]; srPartySpec.numConvs _ partySpec.numConvs; srPartySpec.enabled _ partySpec.enabled; srPartySpec.voicePath _ partySpec.voicePath; srPartySpec.partyActive _ partySpec.partyActive; srPartySpec.partyEngaged _ partySpec.partyEngaged; srPartySpec.socket _ AddressToSr[partySpec.socket]; srPartySpec.partyAttributes _ AttributesToSr[partySpec.partyAttributes]; }; SrToROPE: PUBLIC PROC [srRope: Rope.ROPE] RETURNS [rope: Rope.ROPE] ~ { rope _ IF Rope.Equal[srRope, "sunRPCRopeReallyNIL"] THEN NIL ELSE srRope; }; ROPEToSr: PUBLIC PROC [rope: Rope.ROPE] RETURNS [srRope: Rope.ROPE] ~ { srRope _ IF rope=NIL THEN "sunRPCRopeReallyNIL" ELSE rope; }; SrToSmartsProperties: PUBLIC PROC [srProperties: ThPartySunRPC.SmartsProperties] RETURNS [properties: ThParty.SmartsProperties] ~ { properties.role _ SrToATOM[srProperties.role]; properties.netAddress _ SrToAddress[srProperties.netAddress]; }; SmartsPropertiesToSr: PUBLIC PROC [properties: ThParty.SmartsProperties] RETURNS [srProperties: ThPartySunRPC.SmartsProperties] ~ { srProperties.role _ ATOMToSr[properties.role]; srProperties.netAddress _ AddressToSr[properties.netAddress]; }; SrToUsers: PUBLIC PROC [srUsers: VoiceRopeServerSunRPC.Users] RETURNS [users: VoiceRopeServer.Users_NIL] ~ { FOR i: CARDINAL DECREASING IN [0..srUsers.length) DO users _ CONS[SrToROPE[srUsers[i]], users]; ENDLOOP; }; UsersToSr: PUBLIC PROC [users: VoiceRopeServer.Users] RETURNS [srUsers: VoiceRopeServerSunRPC.Users] ~ { count: CARDINAL _ 0; FOR u: VoiceRopeServer.Users _ users, u.rest WHILE u # NIL DO count _ count + 1; ENDLOOP; srUsers _ NEW[VoiceRopeServerSunRPC.UsersObject[count]]; count _ 0; FOR u: VoiceRopeServer.Users _ users, u.rest WHILE u # NIL DO srUsers[count] _ ROPEToSr[u.first]; count _ count + 1; ENDLOOP; }; SrToVersionRange: PUBLIC PROC [srVersion: ThrushSunRPC.VersionRange] RETURNS [version: RPC.VersionRange] ~ { version.first _ srVersion.first; version.last _ srVersion.last; }; VersionRangeToSr: PUBLIC PROC [version: RPC.VersionRange] RETURNS [srVersion: ThrushSunRPC.VersionRange] ~ { srVersion.first _ version.first; srVersion.last _ version.last; }; SrToVisitorList: PUBLIC PROC [srVisitorList: ThPartySunRPC.VisitorList] RETURNS [visitorList: LIST OF Thrush.PartyID_NIL] ~ { FOR i: CARDINAL DECREASING IN [0..srVisitorList.length) DO partyID: Thrush.PartyID _ srVisitorList[i]; visitorList _ CONS[partyID, visitorList]; ENDLOOP; }; VisitorListToSr: PUBLIC PROC [visitorList: LIST OF Thrush.PartyID] RETURNS [srVisitorList: ThPartySunRPC.VisitorList] ~ { count: CARDINAL _ 0; FOR a: LIST OF Thrush.PartyID _ visitorList, a.rest WHILE a # NIL DO count _ count + 1; ENDLOOP; srVisitorList _ NEW[ThPartySunRPC.VisitorListObject[count]]; count _ 0; FOR a: LIST OF Thrush.PartyID _ visitorList, a.rest WHILE a # NIL DO srVisitorList[count] _ a.first; count _ count + 1; ENDLOOP; }; SrToVoiceBlock: PUBLIC PROC [srVoiceBlock: VoiceRopeServerSunRPC.VoiceBlock] RETURNS [voiceBlock: VoiceRopeServer.VoiceBlock] ~ { IF srVoiceBlock.length=0 THEN RETURN; voiceBlock _ NEW[VoiceRopeServer.VoiceBlockRec[srVoiceBlock.length]]; FOR i: CARDINAL DECREASING IN [0..srVoiceBlock.length) DO voiceBlock[i] _ srVoiceBlock[i]; ENDLOOP; }; VoiceBlockToSr: PUBLIC PROC [voiceBlock: VoiceRopeServer.VoiceBlock] RETURNS [srVoiceBlock: VoiceRopeServerSunRPC.VoiceBlock] ~ { length: CARDINAL _ IF voiceBlock=NIL THEN 0 ELSE voiceBlock.length; srVoiceBlock _ NEW[VoiceRopeServerSunRPC.VoiceBlockObject[length]]; FOR i: CARDINAL DECREASING IN [0..length) DO srVoiceBlock[i] _ voiceBlock[i]; ENDLOOP; }; SrToVoiceRope: PUBLIC PROC [srVoiceRope: VoiceRopeServerSunRPC.VoiceRope] RETURNS [voiceRope: VoiceRopeServer.VoiceRope_NIL] ~ { IF Rope.Equal[srVoiceRope.ropeID, "sunRPCContainerReallyNIL"] THEN RETURN; voiceRope _ NEW[VoiceRopeServer.VoiceRopeInterval]; voiceRope.ropeID _ SrToROPE[srVoiceRope.ropeID]; voiceRope.start _ srVoiceRope.start; voiceRope.length _ srVoiceRope.length; }; VoiceRopeToSr: PUBLIC PROC [voiceRope: VoiceRopeServer.VoiceRope] RETURNS [srVoiceRope: VoiceRopeServerSunRPC.VoiceRope] ~ { IF voiceRope=NIL THEN voiceRope _ NEW[VoiceRopeServer.VoiceRopeInterval _ [ ropeID: "sunRPCContainerReallyNIL", start: 0, length: -1] ]; srVoiceRope.ropeID _ ROPEToSr[voiceRope.ropeID]; srVoiceRope.start _ voiceRope.start; srVoiceRope.length _ voiceRope.length; }; }. ”ThrushSunRPCConvertImpl.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. This module contains procedures for translating SunRPC data types to Thrush data types and Thrush data types to SunRPC data types. Pier, May 24, 1990 2:05:24 pm PDT Polle Zellweger (PTZ) December 2, 1990 6:45:05 pm PST Polle Zellweger (PTZ) May 14, 1990 6:03:26 pm PDT Atom.GetPName couldn't handle NIL, so make a new conversion routine. new: SrToATOM, ATOMToSr changes to: DIRECTORY, SrToAccessList, SrToActionReport, ActionReportToSr, SrToAttributes, AttributesToSr, SrToConvEvent, ConvEventToSr, SrToPartyInfoSpec, PartyInfoSpecToSr, SrToSmartsProperties, SmartsPropertiesToSr Polle Zellweger (PTZ) May 27, 1990 5:06:21 pm PDT changes to: ATOMToSr, SrToPartyInfo, DIRECTORY Polle Zellweger (PTZ) May 27, 1990 4:56:57 pm PDT SunRPC can't marshal NIL, so fill in each REF going toward the wire with a distinguishable instance of its type that means NIL (values are called sunRPCContainerReallyNIL in some flavor). Similarly, detect these values going away from the wire and turn them back into NIL. Note that ropes are not explicitly caught - NIL ropes turn into "". Polle Zellweger (PTZ) October 29, 1990 3:26:40 pm PST Fix NIL ropes too, via sunRPCRopeReallyNIL value. new: ROPEToSr, SrToROPE changes to: AccessListToSr, SrToAccessList, PartyInfoSpecToSr, SrToPartyInfoSpec, UsersToSr, SrToUsers, SrToVoiceRope, VoiceRopeToSr Κn˜code™K™K˜0K˜@K˜>K˜>K˜———˜šžœœœ$˜Ašœ0˜7K˜9K˜;K˜>K˜0K˜@K˜>K˜>K˜———˜šž œœœ"˜:šœ!˜(K˜"K˜%K˜&K˜&K˜&K˜&K˜———˜šž œœœœ ˜C˜Kšœ"Οc%˜GK˜#K˜&K˜&K˜&K˜&K˜———˜šžœœœœ˜)šœœ˜Kš œœœœœ˜IK˜———˜š žœœœœœœ˜BKš œ œœœœœ˜7K˜——˜šžœœœ)˜Dšœ!œ˜0š œœ œœ˜9K˜UKšœ œ˜$Kšœ˜—K˜———˜šžœœœ!˜<šœ-˜4Kšœœ˜šœ,œœ˜?K˜Kšœ˜—Kšœœ#˜5K˜ šœ,œœ˜?K˜2K˜*K˜Kšœ˜—K˜———˜šžœœœ,˜Jšœœœœ˜>š œœ œœ˜9K˜HKšœ œ˜%Kšœ˜—K˜———˜š žœœœœœ˜Mšœ0˜7Kšœœ˜š œœœ.œœ˜MK˜Kšœ˜—Kšœœ+˜=K˜ š œœœ.œœ˜MK˜4K˜Kšœ˜—K˜———˜šž œœœ&˜@šœœ˜-Kšœ:œœ˜Hšœ œ˜(K˜(K˜*K˜5K˜%K˜(K˜—K˜———˜šž œœœ˜8šœ*˜1šœ œ˜Kšœ œ=˜M—˜K˜&K˜(K˜2K˜#K˜$K˜—K˜———˜šžœœœ*˜Kšœ"œ˜1Kšœ-œœ˜;KšœœA˜LK˜K˜——šžœœœ"˜Cšœ.˜5Kšœœœ œ˜;Kšœ*˜*Kšœœœ-˜>K˜K˜——šžœœœ*˜Nšœ,˜3šœ ˜ K˜7K˜K˜K˜K˜K˜4K˜=K˜%K˜:K˜7K˜K˜ K˜—K˜———˜šžœœœ(˜Lšœ.˜5˜ Kšœ8˜8K˜ K˜K˜K˜ K˜5Kšœ>˜>K˜&Kšœ;˜;K˜8K˜K˜!K˜—K˜———˜šžœœœ*˜Fšœ&˜-˜K˜K˜!˜K˜5—K˜:Kšœ œ˜#K˜—K˜———˜šžœœœ"˜>šœ.˜5˜K˜K˜K˜;K˜8K˜K˜—K˜———˜šžœœœ9˜Xšœ1œ˜@Kšœœœ˜)Kšœœ=˜Qš œœ œœ˜=K˜(Kšœ˜—K˜———˜šžœœœ1˜Pšœ=˜DKš œœœœœœ˜KKšœœ5˜Kš œœ œœ ˜,K˜(Kšœ˜—K˜———˜šžœœœ*˜Hšœ œ˜*K˜"K˜*K˜:K˜———˜šžœœœ œ˜=šœ.˜5K˜"K˜*K˜:K˜———˜šžœœœ.˜Lšœ*˜1K˜OK˜?K˜4K˜8K˜———˜šžœœœ&˜Dšœ2˜9K˜OK˜?K˜4K˜8K˜———˜šžœœœ7˜Ušœ/œ˜>šž œœ'˜@˜#K˜K˜K˜——š œœ œœ˜œœ˜LKšœœ1˜˜OK˜———˜šžœœœ+˜Išœ'˜.K˜(K˜,K˜8K˜