<> <> <> <<>> <> DIRECTORY Commander, ComputeClient, ComputeServerClient, FS, IO, Pup, PupName, Rope ; RTeX: CEDAR PROGRAM IMPORTS Commander, ComputeClient, FS, IO, PupName, Rope = BEGIN RTeXCommand: Commander.CommandProc = { <<[cmd: Commander.Handle] RETURNS [result: REF ANY _ NIL, msg: ROPE _ NIL]>> success: ComputeServerClient.RemoteSuccess; found: BOOL; cp: FS.ComponentPositions; fullName: Rope.ROPE; command: Rope.ROPE; server: Rope.ROPE; [fullFName: fullName, cp: cp] _ FS.ExpandName[cmd.command]; command _ fullName.Substr[cp.base.start, cp.base.length]; [found: found, success: success, remoteMsg: msg, serverInstance: server] _ ComputeClient.StartService[ service: command, cmdLine: cmd.commandLine, in: cmd.in, out: cmd.out, queueService: TRUE ]; IF success = aborted THEN ERROR ABORTED ELSE IF NOT found OR success # true THEN cmd.out.PutF["%g failed: Not found or bad success returned.\n", IO.rope[command]] ELSE cmd.out.PutF["Remote TeX server was %g(%g)\n", IO.rope[PupName.HisName[PupName.NameLookup[server, Pup.nullSocket]]], IO.rope[server] ]; }; Commander.Register[ key: "RTeX", proc: RTeXCommand, doc: "Runs a remote version of TeX, a document compiler", interpreted: FALSE]; Commander.Register[ key: "RIniTeX", proc: RTeXCommand, doc: "Runs a remote version of IniTeX, an initialising version of a document compiler", interpreted: FALSE]; Commander.Register[ key: "RInterruptTeX", proc: RTeXCommand, doc: "Interrupts a currently-running remote version of TeX, a document compiler"]; END. <> <> <<>>