DIRECTORY IO USING [STREAM, UnsafeBlock], Rope USING [ROPE]; XCommunications: CEDAR DEFINITIONS ~ BEGIN Error: ERROR [what: Rope.ROPE]; ProtocolData: TYPE = RECORD [ create: PROC [base: Rope.ROPE, port: REF ANY] RETURNS [StreamData] ¬ NIL, protocol: ATOM ¬ NIL, success: BOOL ¬ FALSE ]; StreamData: TYPE = RECORD [ in, out: IO.STREAM ¬ NIL, putChar: PROC [self: IO.STREAM, char: CHAR] ¬ NIL, -- IO.PutChar, unsafePutBlock: PROC [self: IO.STREAM, block: IO.UnsafeBlock] ¬ NIL, -- IO.UnsafePutBlock, getChar: PROC [self: IO.STREAM] RETURNS [CHAR] ¬ NIL, -- IO.GetChar, sendNow: PROC [self: IO.STREAM] ¬ NIL, -- IO.Flush, errorFromStream: PROC [self: IO.STREAM] RETURNS [Rope.ROPE] ¬ NIL, errorMsg: Rope.ROPE ¬ NIL, success: BOOL ¬ FALSE ]; ScannedName: TYPE = RECORD [ protocol: Rope.ROPE, server: Rope.ROPE, specific: Rope.ROPE --interpretation depends on both, protocol and application ]; ScanName: PROC [name: Rope.ROPE] RETURNS [ScannedName]; GetProtocol: PROC [protocol: Rope.ROPE ¬ NIL, defaultProtocol: ATOM ¬ NIL] RETURNS [ProtocolData]; ScanSpecific: PROC [application: ATOM, protocol: ATOM, scannedName: ScannedName] RETURNS [base: Rope.ROPE, port: REF ANY]; CreateStreams: PROC [application: ATOM, name: Rope.ROPE, defaultProtocol: ATOM ¬ NIL] RETURNS [StreamData]; RegisterCommunication: PROC [protocolData: ProtocolData]; ScanProcType: TYPE = PROC [application: ATOM, protocol: ATOM, scannedName: ScannedName] RETURNS [base: Rope.ROPE, port: REF ANY]; RegisterScanSpecific: PROC [application: ATOM, protocol: ATOM, scan: ScanProcType]; FinishStreamData: PROC [sd: StreamData] RETURNS [StreamData]; END. ϊ XCommunications.mesa Copyright Σ 1988, 1989, 1991 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, July 29, 1988 2:30:53 pm PDT Christian Jacobi, February 17, 1989 1:16:23 pm PST Module name means both --communication base for X --or --inter application shared communication base --May be a faster proc which guarantees delivery soon but without waiting --In case IO.Failure was raised Scans a name into parts; the name is supposed to have the right syntax. Error is raised if name syntactically wrong. Find communication protocol to be used. defaultProtocol used if protocol is empty Does not raise errors Scans scanned name into necessary create parameters. The scan proc may ignore the protocol field of scannedName. Error is raised if application/protocol not registered The doit all procedure for simple applications. Returns streams or error message on failure; err=NIL means success Does not raise errors To be called by implementor of communication protocols. The create proc may assume that its caller will also call FinishStreamData. To be called by implementor of application programs, once per supported protocol. The scan proc may ignore the protocol field of scannedName. Fills in defaulted fields into StreamData record ΚΑ–(cedarcode) style•NewlineDelimiter ™šœ™Icodešœ Οeœ=™HKšœ6Οk™9Kšœ2™2—K˜šž ˜ Kšžœžœžœ ˜Kšœžœžœ˜—K˜šΟnœžœž ˜"™K™K™K™.——šœž˜K˜—KšŸœžœ žœ˜K˜šœžœžœ˜Kš œžœ žœžœžœžœžœ˜IKšœ žœžœ˜Kšœ žœž˜Kšœ˜—K˜šœ žœžœ˜Kšœ žœžœžœ˜Kš œ žœžœžœžœžœΟc˜BKš œžœžœžœ žœžœ ˜ZKšœ žœžœžœžœžœžœ ˜Eš œ žœžœžœžœ  ˜4Kš J™J—š œžœžœžœžœžœžœ˜BKš ™—Kšœžœžœ˜Kšœ žœž˜Kšœ˜—K˜šœ žœžœ˜Kšœžœ˜Kšœ žœ˜Kšœžœ :˜NKšœ˜—K˜šŸœžœ žœžœ˜7K™GKšœ,™,—K˜šŸ œžœžœžœžœžœžœ˜bK™'Kšœ)™)K™—K˜šŸ œžœžœ žœžœ žœžœžœ˜zKšœ5™5Kšœ;™;Kšœ7™7—K˜šŸ œžœžœ žœžœžœžœ˜kKšœ/™/Kš -œ™BK™K™—K˜šŸœžœ˜9Kšœ7™7KšœK™K—K˜Kšœžœžœžœ žœžœ žœžœžœ˜K˜šŸœžœžœ žœ˜SKšœQ™QKšœ;™;—K˜šŸœžœžœ˜=Kšœ0™0—K˜Kšžœ˜K˜K˜—…—d