MsgOps.mesa
Copyright (C) 1985, 1986 by Xerox Corporation. All rights reserved.
Last revised by McManis On: 24-May-85 17:11:12
Tim Diebert: December 2, 1986 5:12:32 pm PST
Provides various message operations of general interest to services.
DIRECTORY
NSString USING [String],
Rope USING [ROPE],
XMessage USING [ClientData, DestroyMsgsProc, Handle, MsgKey, MsgDomains];
MsgOps: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE ~ Rope.ROPE;
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Errors:
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Error: ERROR [type: ErrorType];
ErrorType: TYPE = {fileNotFound, noSuchDomain};
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Operations on XMessage files:
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
DomainsFromFile: PROCEDURE [file: ROPE, clientData: XMessage.ClientData,
proc: XMessage.DestroyMsgsProc] RETURNS [domains: REF XMessage.MsgDomains];
initializes messages from "file" in services working directory. "proc" is called with "clientData" if messages are ever destroyed via XMessage.DestroyMessages. Storage for "domains" should be freed by calling XMessage.FreeMsgDomainsStorage. Raises Error[fileNotFound] if file does not exist.
HandleFromFile: PROCEDURE [file, domainName: ROPE, clientData: XMessage.ClientData,
proc: XMessage.DestroyMsgsProc] RETURNS [h: XMessage.Handle];
initializes messages from "file" in services working directory. Returns the message handle corresponding to "domainName". Useful when a client has all of its messages in a single domain. "proc" is called with "clientData" if messages are ever destroyed via XMessage.DestroyMessages. Raises Error[fileNotFound] if file does not exist and Error[noSuchDomain] if "domainName" cannot be found in file.
ServiceNameFromFile: PROCEDURE [file, domainName: ROPE, key: XMessage.MsgKey,
mustInstallFile: BOOLEAN] RETURNS [name: NSString.String];
initializes messages from "file". If "mustInstallFile" is TRUE, then "file" will be copied from the services installation source before it is initialized, otherwise "file" is initialized directly from the services working directory. Gets message corresponding to "key" in "domainName", copies the message to "name", allocating necessary storage from "z". Then unloads "file", destroying all messages. Client is responsible for freeing "name" when it is no longer needed. Raises Error[fileNotFound] if "file" cannot be found in services working directory or if "mustInstallFile" is TRUE and file cannot be found at installation source. Raises Error[noSuchDomain] if "domainName" cannot be found in "file".
END.
Log [Time - Person - Action]
24-Apr-85 14:12:45 - McManis - Created.
29-Apr-85 10:48:47 - McManis - Added Compose and ComposeOne.
6-May-85 14:50:04 - McManis - Added AuthErr* and ServiceNameFromFile.
24-May-85 17:09:57 - McManis - Added ElapsedTimeMsg and TotalTimeMsg.