DIRECTORY Arpa, Basics, SunPMap, SunPMapClient, SunPMapLocal, SunRPC, SunRPCOnUDP, SunRPCAuth ; SunPMapLocalImpl: CEDAR PROGRAM IMPORTS Basics, SunPMapClient, SunRPC, SunRPCOnUDP, SunRPCAuth EXPORTS SunPMapLocal ~ { RPCHandle: TYPE ~ SunRPC.Handle; Conversation: TYPE ~ SunRPCAuth.Conversation; MapEntry: TYPE ~ SunPMap.MapEntry; Error: ERROR ~ CODE; InnerProc: TYPE ~ PROC [rpcH: RPCHandle, c: Conversation]; CallSelf: PROC [proc: InnerProc] ~ { rpcH: SunRPC.Handle ¬ NIL; c: SunRPCAuth.Conversation ¬ NIL; Cleanup: PROC ~ { IF rpcH # NIL THEN { SunRPC.Destroy[rpcH]; rpcH ¬ NIL }; IF c # NIL THEN { SunRPCAuth.Terminate[c]; c ¬ NIL }; }; { ENABLE { UNWIND => Cleanup[]; SunRPC.Error, SunRPCAuth.Error => ERROR Error; }; rpcH ¬ SunRPCOnUDP.Create[ remoteAddress~Arpa.nullAddress, -- ME remotePort~Basics.HFromCard16[CARD16[SunPMap.udpPort]] ]; c ¬ SunRPCAuth.Initiate[]; proc[rpcH, c]; }; Cleanup[]; }; SetLocal: PUBLIC PROC [program, version, protocol, port: CARD32] RETURNS [success: BOOL] ~ { SetLocalInner: InnerProc ~ { success ¬ SunPMapClient.Set[rpcH, c, program, version, protocol, port]; }; CallSelf[ SetLocalInner ! Error => { success ¬ FALSE; CONTINUE }]; }; UnsetLocal: PUBLIC PROC [program, version: CARD32] RETURNS [success: BOOL] ~ { UnsetLocalInner: InnerProc ~ { success ¬ SunPMapClient.Unset[rpcH, c, program, version]; }; CallSelf[ UnsetLocalInner ! Error => { success ¬ FALSE; CONTINUE }]; }; GetPortLocal: PUBLIC PROC [program, version, protocol: CARD32] RETURNS [port: CARD32] ~ { GetPortLocalInner: InnerProc ~ { port ¬ SunPMapClient.GetPort[rpcH, c, program, version, protocol]; }; CallSelf[ GetPortLocalInner ! Error => { port ¬ 0; CONTINUE }]; }; DumpLocal: PUBLIC PROC [eachMapEntry: PROC[MapEntry]] ~ { DumpLocalInner: InnerProc ~ { SunPMapClient.Dump[rpcH, c, eachMapEntry]; }; CallSelf[ DumpLocalInner ! Error => { CONTINUE }]; }; CallItLocal: PUBLIC PROC [program, version, proc: CARD32, args: REF TEXT, timeout: CARD, retries: CARD] RETURNS [port: CARD32, result: REF TEXT] ~ { CallItLocalInner: InnerProc ~ { [port, result] ¬ SunPMapClient.Callit[rpcH, c, program, version, proc, args, timeout]; }; CallSelf[ CallItLocalInner ! Error => { port ¬ 0; result ¬ NIL; CONTINUE }]; }; }.  SunPMapLocalImpl.mesa Copyright Σ 1989, 1991, 1992 by Xerox Corporation. All rights reserved. Demers, November 2, 1988 10:35:38 am PST Willie-Sue, March 16, 1989 6:55:00 pm PST Willie-s, August 21, 1991 12:39 pm PDT Chauser, January 3, 1992 10:56 am PST Types Procedures Κ/•NewlineDelimiter –(cedarcode) style™code™Kšœ Οeœ=™HK™(K™)K™&K™%K˜—šΟk ˜ K˜K˜K˜K˜K˜ K˜K˜ K˜ K˜K˜—šΟnœžœž˜Kšžœ7˜>Kšžœ ˜K˜head™Kšœ žœ˜ Kšœžœ˜-K˜Kšœ žœ˜"—™ KšŸœžœžœ˜K˜Kšœ žœžœ$˜:K˜šŸœžœ˜$Kšœžœ˜Kšœžœ˜!šŸœžœ˜Kšžœžœžœ žœ˜8Kšžœžœžœ žœ˜5K˜—˜šžœ˜Kšžœ˜Kšœ"žœ˜.K˜—šœ˜Kšœ Οc˜%Kšœžœ˜6Kšœ˜—K˜K˜K˜—K˜ K˜K˜—š Ÿœžœžœ$žœžœ žœ˜\šŸ œ˜KšœG˜GK˜—Kšœ/žœžœ˜BK˜K˜—š Ÿ œžœžœžœžœ žœ˜NšŸœ˜Kšœ9˜9K˜—Kšœ1žœžœ˜DK˜K˜—š Ÿ œžœžœžœžœžœ˜YšŸœ˜ KšœB˜BK˜—Kšœ3žœ˜?K˜K˜—šŸ œžœžœžœ˜9šŸœ˜Kšœ*˜*K˜—Kšœ&žœ˜2K˜K˜—šŸ œžœžœžœžœžœ žœ žœžœžœ žœžœ˜”šŸœ˜KšœV˜VK˜—Kšœ;žœžœ˜LK˜——K˜——…—² ω