DIRECTORY BasicTime USING [Now, Period], Convert USING [Error, IntFromRope], FS USING [Error, FileInfo], VoiceCleanup USING [IsGarbageProc, RegisterClass]; VoiceGarbageProcs: CEDAR PROGRAM IMPORTS BasicTime, Convert, FS, VoiceCleanup ~ BEGIN FileNonExistent: VoiceCleanup.IsGarbageProc ~ { gone: BOOLEAN _ FALSE; [] _ FS.FileInfo[interest.refID ! FS.Error => { IF error.group = user AND error.code = $unknownFile THEN gone _ TRUE; CONTINUE}]; RETURN[gone]; }; TimeoutExpired: VoiceCleanup.IsGarbageProc ~ { timeout: INT; timeout _ Convert.IntFromRope[interest.data ! Convert.Error => {timeout _ 0; CONTINUE}]; RETURN[BasicTime.Period[from: interest.timestamp, to: BasicTime.Now[]] > timeout]; }; Permanent: VoiceCleanup.IsGarbageProc ~ { RETURN[FALSE]; }; MsgDeleted: VoiceCleanup.IsGarbageProc ~ { RETURN[FALSE]; }; VoiceCleanup.RegisterClass[class: "WalnutMsg", proc: MsgDeleted]; VoiceCleanup.RegisterClass[class: "SysNoises", proc: Permanent]; VoiceCleanup.RegisterClass[class: "Timeout", proc: TimeoutExpired]; VoiceCleanup.RegisterClass[class: "TiogaVoice", proc: FileNonExistent]; END. .VoiceGarbageProcs.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Doug Terry, June 30, 1986 3:04:42 pm PDT Class-specific procedures for determining whether a registered interest in a voice rope is still valid. TiogaVoice For interests of type "TiogaVoice", the refID is the name of a Tioga file containing voice annotations. An interest can be collected when the file no longer exists. PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEAN _ FALSE] Timeout For interests of type "Timeout", the refID is irrelevant (it may be the name of a Tioga file containing voice annotations); the data field contains a timeout value in seconds. An interest can be collected when the time since creation is greater than this timeout. PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEAN _ FALSE] SysNoises For interests of type "SysNoises", the refID is a name for a recorded sound, such as "BeepTune" or "Rollback". Interests of this class are never implicitly collected. PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEAN _ FALSE] WalnutMsg For interests of type "WalnutMsg", the refID is the ID of a Grapevine message. Currently, such interests are explictly collected when Walnut expunges deleted messages; no implicit collection is done. PROC[interest: VoiceCleanup.InterestInfo] RETURNS [BOOLEAN _ FALSE] Registration Doug Terry, June 16, 1986 3:34:18 pm PDT Created. changes to: DIRECTORY, VoiceGarbageProcs, IMPORTS, ~, FileNonExistent, TimeoutExpired, Permanent, MsgDeleted, VoiceCleanup, VoiceCleanup, VoiceCleanup, VoiceCleanup, END Doug Terry, June 30, 1986 1:28:29 pm PDT changes to: FileNonExistent Doug Terry, June 30, 1986 3:03:08 pm PDT changes to: TimeoutExpired, timeout (local of TimeoutExpired) Doug Terry, June 30, 1986 3:04:42 pm PDT changes to: DIRECTORY, TimeoutExpired ΚΙ˜codešœ™Kšœ Οmœ1™