NamesGVExportImpl.Mesa
Last modified by Swinehart, June 14, 1984 5:28:40 pm PDT
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandToolExtras USING [ NumArgs, ArgN ],
NamesGVImpExp,
NamesGVRpcControl USING [ ExportInterface ],
IO,
Log USING [ Problem, Report ],
Names USING [ CurrentRName, CurrentPasskey, ROPE ],
RPC USING [ ExportFailed ],
UserProfile USING [ Token ]
;
NamesGVExportImpl: CEDAR PROGRAM
IMPORTS Commander, CommandToolExtras, IO, Log, RPC, Names, NamesGVRpcControl, UserProfile
EXPORTS NamesGVImpExp = {
OPEN IO;
Data
ROPE: TYPE= Names.ROPE;
exported: BOOLFALSE;
Import Procedure
GVExport: PUBLIC PROC [instance: ROPENIL] RETURNS [success: BOOL] = {
ENABLE
RPC.ExportFailed => { Log.Problem["Couldn't export NamesGV.Lark"]; CONTINUE; };
IF instance=NIL THEN
instance ← UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"];
IF ~exported THEN NamesGVRpcControl.ExportInterface [
interfaceName: [
type: "NamesGV.Lark",
instance: instance
],
user: Names.CurrentRName[],
password: Names.CurrentPasskey[]
];
exported ← TRUE;
Log.Report[IO.PutFR["ExportInterface[NamesGV.Lark, %s]", rope[instance]], $System];
};
User command
CmdGVExport: Commander.CommandProc = {
[]←GVExport[IF CommandToolExtras.NumArgs[cmd]#0 THEN CommandToolExtras.ArgN[cmd,1] ELSE NIL];
};
Initialization
Commander.Register["GVExport", CmdGVExport, "Supply a remote NamesGV."];
}.