DIRECTORY Commander USING [ Handle ], GVBasics USING [ Password ], IO USING [ STREAM, Value ], Rope USING [ ROPE ], RPC USING [ EncryptionKey ], Pup USING [ Address, nullAddress ] ; VoiceUtils: CEDAR DEFINITIONS = { PD: TYPE = RECORD [ attended: BOOLEAN_FALSE, sysIn: IO.STREAM, sysOut: IO.STREAM, -- IOs for error and system status reporting ch: Commander.Handle_NIL, reportLimit: NAT_200, -- If 200 (say) reports of any kind, or 10 problem reports, are problemLimit: NAT_10, -- issued in any 60 second period, report that (high priority), and limitInterval: NAT_60, -- then inhibit all reports until these limits have not been exceeded reportingEnabled: BOOL_TRUE, -- whether the limits have been reached reportMethods: ARRAY ProblemPriority OF ReportMethod _ ALL[], maximumMailReportInterval: INT _ 60*15 -- mailed reports no more frequently than 4/hr. ]; pd: REF PD; ROPE: TYPE=Rope.ROPE; Rname: TYPE = ROPE; NetAddress: TYPE = Pup.Address; nullNetAddress: Pup.Address = Pup.nullAddress; WhereToReport: TYPE=ATOM; WhereProc: TYPE = PROC[fixedWhereData: REF, whereData: REF] RETURNS[s: IO.STREAM_NIL]; nullValue: IO.Value = [null[]]; DNFProc: TYPE = PROC[fixedWhereData: REF, whereData: REF] RETURNS[default: BOOL]; RegisterWhereToReport: PROC[ proc: WhereProc_NIL, where: WhereToReport, fixedWhereData: REF_NIL, defaultIfNotFound: DNFProc_NIL]; FindWhere: PROC[where: WhereToReport, whereData: REF] RETURNS [s: IO.STREAM_NIL]; ReportMethod: TYPE = RECORD [ reportByMail: BOOL_FALSE, reportTo: ROPE ]; Report: PROC[remark: ROPE, where: WhereToReport_NIL, whereData: REF _NIL]; ReportFR: PROC[remark: ROPE, where: WhereToReport_NIL, whereData: REF _NIL, a1, a2, a3: IO.Value _ nullValue]; ProblemPriority: TYPE = { minimal, low, medium, high, maximum }; Problem: PROC[ remark: ROPE_NIL, where: WhereToReport_NIL, whereData: REF _NIL, priority: ProblemPriority _ maximum]; ProblemFR: PROC[ remark: ROPE_NIL, where: WhereToReport_NIL, whereData: REF _NIL, a1, a2: IO.Value _ nullValue, priority: ProblemPriority _ maximum]; Registrize: PROC[name: ROPE] RETURNS [ROPE]; CurrentRName: PROC RETURNS [ROPE]; CurrentPasskey: PROC[passwordText: ROPE_NIL] RETURNS [RPC.EncryptionKey]; CurrentPassword: PROC[passwordText: ROPE_NIL] RETURNS [GVBasics.Password] = INLINE { RETURN[LOOPHOLE[CurrentPasskey[passwordText]]]; }; OwnNetAddress: PROC RETURNS [netAddress: NetAddress]; NetAddressFromRope: PROC [netAddressRope: ROPE] RETURNS [netAddress: NetAddress]; Rspec: TYPE = REF RspecBody; RspecBody: TYPE = RECORD [ simpleName: ROPE_NIL, registry: ROPE_NIL]; RNameStyle: TYPE = { rName, nameDotLark, rNameDotLark }; InstanceFromNetAddress: PROC[netAddress: NetAddress, suffix: ROPE_NIL] RETURNS [instance: Rname]; RnameToRspec: PROC[name: Rname, defaultRegistry: ROPE_NIL] RETURNS [spec: Rspec]; RspecToRname: PROC[spec: Rspec] RETURNS [name: Rname]; RspecToSortName: PROC[spec: Rspec] RETURNS [name: ROPE]; MakeAtom: PROC[rName: Rname, case: BOOL_FALSE] RETURNS [ATOM]; MakeRName: PROC[name: ROPE, style: RNameStyle_ rNameDotLark] RETURNS[rName: ROPE]; LowerCaseRope: PROC[r: ROPE] RETURNS [ROPE]; CmdOrToken: PROC[cmd: Commander.Handle, key: ROPE, default: ROPE_NIL] RETURNS [value: ROPE]; }. fVoiceUtils.mesa Copyright Σ 1985, 1987 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, February 9, 1987 8:53:13 am PST This interface implements a number of utility routines used by all of the voice system components. Variables Control over system death due to excess report logging Control over mailing of problem reports for various priorities Types Status reporting, Error reporting and management Report finds an appropriate stream and prints a time-stamped version of remark. Clients can register procedures to interpret the WhereToReport atoms and obtain the appropriate stream for a given call, aided by the whereData supplied in the Report call. Problem is intended for reporting unexpected errors and conditions. It will raise an internal SIGNAL if the system is currently attended (there's an executive command.) In any case, it will Report the remark argument. It will return automatically or if the operator proceeds from the signal, so the caller needs to do what is necessary to recover after calling Problem. The defaultIfNotFound parameter to the registration procedure indicates whether the message should be ignored (FALSE) or printed (TRUE) when the corresponding stream-finding procedure returns NIL. IF defaultIfNotFound=NIL, answer assumed TRUE Simple RName, password, net address manipulations. These just look at local machine global information or do various kinds of parsing; they don't do any communicating. Adds the Default registry to the name if the name doesn't have a registry field. Current logged-in name. Keys made from logged in password. The two types are based on client needs. Returns instance name, concatenated with suffix. Suffix could be "0" to complete a text version of a socket ID, or ".lark" to complete an RName. Takes the fields of an Rname apart. Puts one back together. Produces a rope of the form registry.name Produces a case-independent (if case=FALSE) unique atom from the RName CommandTool parsing aid Swinehart, July 19, 1985 2:34:21 pm PDT Clean up, eliminate SLOG stuff (Break Tool, Spy, Celtics dominate), DIRECTORY, Log Swinehart, October 24, 1985 3:48:07 pm PDT This was always Log until now. Eliminate CLog stuff, GetBinding stuff, combine with Names (also pruned severely), CurrentPasskey, ROPE, NetAddress, Rname Swinehart, October 28, 1985 10:02:53 am PST Eliminate ProblemBool, ProblemHandle changes to: WhereToReport, ProblemFR Swinehart, February 8, 1987 9:22:33 am PST Add Problem, ProblemFR priorities -- determines how hard to work in order to report them. changes to: ProblemPriority, Problem, ProblemFR, PD, ReportMethod, Report, DIRECTORY Κ ˜šœ™IcodešœB™BJšœ>™>—J˜J™bJ™šΟk ˜ Jšœ œ ˜Jšœ œ˜Jšœœœ ˜Jšœœœ˜Jšœœ˜Jšœœ˜"J˜J˜—Jšœ œ œ˜!J˜šΟc ™ J˜šœœœ˜Jšœ œœ˜Jšœœœ˜Jšœœœž-˜@Jšœœ˜™6Jšœ œž?˜UJšœœžC˜YJšœœžE˜\Jšœœœ)˜D—™>Jšœœœ˜=Jšœœ ž/˜V—J˜—Jšœœœ˜ J˜—™J˜Jšœœœ˜Jšœœœ˜šœ œ˜J˜.—J˜—™0Jš ΟnœBŸœ4Ÿ œHŸ œŸœ™ύJš ŸœXœ[ŸœŸœ›Ÿœ™τJšœΟbœYœœ:™ΔJ˜Jšœœœ˜JšŸ œœœœ œœœœœ˜VJšœ œ˜JšŸœœœœ œœ œ˜QšŸœœ˜Jš œœ(œœœ˜dJšœœ™-—JšŸ œœ"œœœœœ˜QJ˜šœœœ˜Jšœœœ˜Jšœ ˜J˜J˜—Jš Ÿœœ œœ œœ˜Jš Ÿœœ œœ œœ˜KJšœ œ˜"—J˜Jšœœ+˜@J˜šŸœœ˜Jš œœœœ œœ˜@Jšœ%˜%—šŸ œœ˜š œœœœ œœ˜@Jšœœ9˜C——J˜—™¨J˜š Ÿ œœœœœ˜,J™P—J˜šŸ œœœœ˜"J™—Jš Ÿœœœœœœ˜Iš Ÿœœœœœœ˜TJšœœ#˜2JšœL™L—J˜JšŸ œœœ˜5JšŸœœœœ˜QJ˜Jšœœœ ˜šœ œœ˜Jšœ œœ˜Jšœ œœ˜J˜—Jšœ œ(˜8J˜šŸœœ!œœ˜FJšœ˜J™0J™_J˜—š Ÿ œœœœœ˜QJšž"œ™#—šŸ œœœ˜6J™—šŸœœœœ˜8J™)—š Ÿœœœœœœ˜>Jšœ%œ™F—Jš Ÿ œœœ"œœ˜RJš Ÿ œœœœœ˜,—J™™J™š Ÿ œœœ œœ˜EJšœ œ˜J˜——J˜™'KšœBΟr™R—K™™*K™KšœQ‘)™z—K™™+K™$Kšœ ‘™$—™*K™YKšœ ‘H™T—K™K™K™—…— ˆω