InstallationComfortsDoc.tioga
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Carl Hauser, May 7, 1990
Chauser, May 7, 1990 2:09 pm PDT
Peter B. Kessler, May 24, 1990 2:54 pm PDT
InstallationComfortsDoc
PCEDAR 2.0 %
InstallationComfortsDoc
Carl Hauser
Ó Copyright 1990 Xerox Corporation. All rights reserved.
Abstract: A collection of handy procedures for trekking around the mesa load state in PCedar, including an easy way for the C (or Mesa) programmer to bind to procedures in Mesa interfaces.
Created by: Carl Hauser
Maintained by: Carl Hauser:PARC:Xerox
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

1. Installation Comforts
There are two interfaces to the same set of access procedures: InstallationComfortsFromC and InstallationComfortsFromMesa. InstallationComfortsFromC procedures take and return parameters of type UXStrings.UnixString (via InstallationSupportPrivate.CString). InstallationComfortsFromMesa procedures take and return parameters of type Rope.ROPE.
See the interfaces for the collection of procedures available. Basically, they let you look up programs, interfaces, and configs in the load state. Procedures that take ``context'' arguments allow it to be NIL (or 0, from C) in which case they use the so-called global context.
ProcFromNamedInterface is available in the C load state as "XR←ProcFromNamedInterface", etc. The C programmer can bind to the MesaProc exported to a Mesa interface by using the code
#include <xr/BasicTypes.h>
MesaProc XR←ProcFromNamedInterface();
MesaProc mp;
mp = XR←ProcFromNamedInterface("interfaceName", "procName", 0);
The mesa program can be called by
(*(mp->mpproc))(args....)
A frustrated Mesa programmer can get at a procedure in an unexported interface by following the example below with the necessary changes (here, finding NewRMTW.CreateCedarModuleSet from PCirio.config in a RawViewersWorldPackage):
InstallationComfortFromMesa.ProcFromInterface[
procName: "CreateCedarModuleSet",
interface: InstallationComfortFromMesa.InterfaceFromConfig[
interfaceName: "NewRMTW",
context: InstallationComfortFromMesa.ChildConfigFromConfig[
configName: "PCirio",
context: InstallationComfortFromMesa.ChildConfigFromConfig[
configName: "RawViewersWorldPackage"
context: NIL]]]];
The result is of type PROCEDURE [] RETURNS [] but there's no guarantee that's really the type of the procedure you now have your hands on.