WalnutRegistry:
CEDAR
DEFINITIONS =
BEGIN
WalnutState:
TYPE = {unknown, active, stopped};
unknown means that Walnut has not notified the registry yet
Event: TYPE = {started, stopped, mailRead, expungeComplete};
EventProc: TYPE = PROC[event: Event, clientData: REF ANY];
MsgEvent: TYPE = {firstRead, deleted, unDeleted};
MsgProc: TYPE = PROC[msgName: Rope.ROPE, event: MsgEvent, clientData: REF ANY];
MsgGroup: TYPE = ARRAY[0..MsgGroupSize) OF Rope.ROPE;
MsgGroupSize: CARDINAL = 20;
MsgGroupEvent: TYPE = {added, destroyed};
MsgGroupProc:
TYPE =
PROC[
msgGroup: REF MsgGroup, event: MsgGroupEvent, clientData: REF ANY];
MsgSetEvent: TYPE = {created, destroyed};
MsgSetProc: TYPE = PROC[msgSetName: Rope.ROPE, event: MsgSetEvent, clientData: REF ANY];
MoveProc:
TYPE =
PROC[
msgName: Rope.ROPE, fromMsgSet, toMsgSet: Rope.ROPE, clientData: REF ANY];
ProcSet:
TYPE =
RECORD[eventProc: EventProc ← NIL,
eventProcData: REF ANY ← NIL,
msgProc: MsgProc ← NIL,
msgProcData: REF ANY ← NIL,
msgGroupProc: MsgGroupProc ← NIL,
msgGroupData: REF ANY ← NIL,
msgSetProc: MsgSetProc ← NIL,
msgSetData: REF ANY ← NIL,
moveProc: MoveProc ← NIL,
moveProcData: REF ANY ← NIL];
Registration: TYPE = REF;
Register:
PROC [procSet: ProcSet, queue: MBQueue.Queue]
RETURNS[registration: Registration];
Register a set of procedures to be invoked when the appropriate database changes occur. Return a registration that can be used to name the set
InvalidRegistration:
ERROR;
Each of the procedures below will raise this error if given a registration that does not currently exist in the table of registered procedures
UnRegister:
PROC [registration: Registration];
Remove the procedures named by the registration
GetProcs:
PROC[registration: Registration]
RETURNS[procSet: ProcSet, queue: MBQueue.Queue];
Return the procedures named by the registration
CurrentWalnutState:
PROC
RETURNS[walnutState: WalnutState];
a quick and safe way to find out if Walnut has been loaded and if it is active or not
END.