RTeX.mesa
Last changed by Pavel on September 30, 1985 12:44:09 pm PDT
This is the ``stub'' of the remote TeX server. This runs on the client workstation and simply packages up a request to send to the server.
DIRECTORY
Commander,
ComputeClient,
ComputeServerClient,
FS,
IO,
PupDefs,
PupTypes,
Rope
;
RTeX: CEDAR PROGRAM
IMPORTS Commander, ComputeClient, FS, IO, PupDefs, 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[PupDefs.GetHostName[
 PupDefs.GetPupAddress[PupTypes.fillInSocketID, server]]],
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.