DIRECTORY IO, FileIO, MessageWindow, PDInterpBasic, PDInterpControl, PDTransfer, PDTransferRpcControl, PDInterpControlRpcControl, MesaRPC; PDTransferImpl: PROGRAM IMPORTS IO, FileIO, MessageWindow, PDInterpControl, PDTransferRpcControl, MesaRPC, PDInterpControlRpcControl EXPORTS PDTransfer ~ BEGIN stream: IO.STREAM _ FileIO.Open["banded.pd"]; ReOpen: PROC ~ {IO.Close[stream]; stream _ FileIO.Open["banded.pd"]}; aborted: BOOLEAN _ FALSE; GetBlock: PUBLIC PROC [sourceIndex: INT, words: INT] RETURNS [dataBlock: PDTransfer.DataBlock] ~ { bytesRead: INT _ stream.UnsafeGetBlock[[@(dataBlock.buffer[0]), 0, 2*MIN[words, PDTransfer.maxWords]]]; dataBlock.words _ bytesRead/2; }; mess: CARDINAL _ 0; ReportStatus: PUBLIC PROC [status: PDInterpBasic.Status, queueSize: NAT, queuePosition: NAT, page, pass, sourceIndex: INT] RETURNS [abort: BOOLEAN] ~ { s: IO.STREAM _ IO.CreateOutputStreamToRope[]; s.Put[IO.refAny[NEW[PDInterpBasic.Status _ status]]]; s.PutRope[", "]; MessageWindow.Append[IO.GetOutputStreamRope[s], mess MOD 4 = 0]; mess _ mess + 1; s.Close[]; abort _ aborted; }; DoIt: PROC ~ { pageSpec: PDInterpControl.PageSpec; requestorName: LONG STRING = "Plass.pa"L; interfaceName: MesaRPC.InterfaceName _ [instance: requestorName]; pageSpec[0] _ [0, LAST[NAT]]; PDTransferRpcControl.ExportInterface[interfaceName: interfaceName, user: "Plass.pa", password: MesaRPC.MakeKey ["iotw3799"] ]; PDInterpControlRpcControl.ImportInterface[[instance: NIL] ! MesaRPC.ImportFailed => { s: IO.STREAM _ IO.CreateOutputStreamToRope[]; s.PutRope["Unable to access PDInterpControl: "]; s.Put[IO.refAny[NEW[MesaRPC.ImportFailure _ why]]]; MessageWindow.Append[IO.GetOutputStreamRope[s], TRUE]; MessageWindow.Blink[]; GOTO Quit; } ]; PDInterpControl.RequestService["Plass.pa", pageSpec]; EXITS Quit => NULL; }; END. DPDTransferImpl.mesa Michael Plass, November 17, 1983 4:25 pm ÊB˜Jšœ™J™(šÏk œœ~˜ŠJ˜—šÏnœ˜Jšœœb˜lJšœ ˜—šœ˜J˜—Jšœœœ˜-Jšžœœœ3˜Ešœ œœ˜J˜—š žœœœœ œœ&˜bJšœ œ7œ˜gJšœ˜Jšœ˜J˜—Jšœœ˜šž œœœ+œœœœ œ˜—Jšœœœœ˜-Jšœœœ"˜5J˜Jšœœœ˜@Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜J˜—šžœœ˜Jšœ#˜#Jšœœœ˜)JšœA˜AJšœœœ˜šœn˜nJšœÏhœ˜ Jšœ˜—šœ5œ˜9šœ˜Jšœœœœ˜-Jšœ0˜0Jšœœœ ˜3Jšœœœ˜6Jšœ˜Jšœ˜ Jšœ˜—Jšœ˜—Jšœ5˜5Jšœ œ˜Jšœ˜J˜—Jšœ˜—…— š