<> <> <> DIRECTORY AMBridge USING [TVToLC], AMTypes USING [IndexToTV, TV], IO USING [PutF], PrincOps USING [zEXCH], PrintTV USING [RegisterRefPrintProc, RegisterTVPrintProc, RefPrintProc, TVPrintProc], PupTypes USING [PupAddress, PupHostID, PupNetID, PupSocketID]; PupDebug: CEDAR PROGRAM IMPORTS AMBridge, AMTypes, IO, PrintTV= { Flip: PROC [PupTypes.PupSocketID] RETURNS [LONG CARDINAL] = TRUSTED MACHINE CODE {PrincOps.zEXCH}; PupAddress: TYPE = PupTypes.PupAddress; PrintRefPupAddress: PrintTV.RefPrintProc = { <<[ref: REF READONLY ANY, data: REF ANY, stream: STREAM, depth: INT _ 4, width: INT _ 32, verbose: BOOL _ FALSE] RETURNS [useOld: BOOL _ FALSE]>> foo: REF READONLY PupAddress _ NARROW[ref]; socket: LONG CARDINAL _ Flip[foo.socket]; IO.PutF[stream, "%B#%B#%B", [integer[foo.net]], [integer[foo.host]], [cardinal[socket]] ]; }; PrintTVPupAddress: PrintTV.TVPrintProc = TRUSTED { <<[tv: TV, data: REF ANY, stream: STREAM, depth: INT _ 4, width: INT _ 32, verbose: BOOL _ FALSE] RETURNS [useOld: BOOL _ FALSE]>> foo: PupAddress; socket: LONG CARDINAL; netTV: AMTypes.TV _ AMTypes.IndexToTV[tv, 1]; hostTV: AMTypes.TV _ AMTypes.IndexToTV[tv, 2]; socketTV: AMTypes.TV _ AMTypes.IndexToTV[tv, 3]; socketTVa: AMTypes.TV _ AMTypes.IndexToTV[socketTV, 1]; socketTVb: AMTypes.TV _ AMTypes.IndexToTV[socketTV, 2]; foo.net _ [AMBridge.TVToLC[netTV]]; foo.host _ [AMBridge.TVToLC[hostTV]]; foo.socket.a _ AMBridge.TVToLC[socketTVa]; foo.socket.b _ AMBridge.TVToLC[socketTVb]; socket _ Flip[foo.socket]; IO.PutF[stream, "%B#%B#%B", [cardinal[foo.net]], [cardinal[foo.host]], [cardinal[socket]] ]; }; PrintTV.RegisterRefPrintProc[CODE[PupAddress], PrintRefPupAddress]; PrintTV.RegisterTVPrintProc[CODE[PupAddress], PrintTVPupAddress]; }.