DIRECTORY BTree, BTreeSimple, BTreeVM, FS, Rope USING [ ROPE ], RefTab USING [ Ref ], VoiceUtils USING [ WhereToReport ] ; ThNet: CEDAR DEFINITIONS = { PD: TYPE = RECORD [ debug: BOOLEAN, -- Diagnostic and progress display encryptionRequested: BOOLEAN, -- Encrypt RPC encryptVoice: BOOLEAN, -- Separate decision; false for debugging only, please! defaultLarkReports: BOOLEAN_FALSE, -- If TRUE and debug, Lark events reported SOMEwhere. autoGVUpdate: BOOLEAN_FALSE, ringsInvalid: BOOL_TRUE, -- set to cause recreation of standard ring tunes tonesVolume: CARDINAL _ 2, defaultRingVolume: CARDINAL _ 2, subduedVolumeInterval: CARDINAL_1, feepVolume: CARDINAL _ 0 ]; pd: REF PD; WPState: TYPE = REF WPStateRecord; WPStateRecord: TYPE = RECORD [ treeRootName: ROPE,-- File name for Tree, FTree, and Data files: extensions determine which wpTree: BTreeSimple.Tree, -- Tree: BTree to white pages, sorted by RName. wpFile: FS.OpenFile, -- open handle for file backing wpTree wpFeepTree: BTreeSimple.Tree, -- Tree: BTree to white pages, sorted by FeepName *. wpFeepFile: FS.OpenFile, -- open handle for file backing wpFeepTree wpDataVMFile: FS.OpenFile, -- File containing the actual white pages entries, wpDataVM: BTreeVM.Handle, -- indexed by entries in both BTrees. Uses BTreeVM to wpDataVMLen: INT_0, -- manage its pages wpDataVMValid: BOOL_TRUE, -- not sure what the value of this is any more. wpExtInt: RefTab.Ref, --Map from names in text-format input files to key ATOMs in tree accessOptions: FS.AccessOptions_$read, -- $read, $create, $write wpOpen: BOOL_FALSE -- TRUE when trees and all their files are ready for business. ]; ROPE: TYPE=Rope.ROPE; WPListing: TYPE = RefTab.Ref; -- a table of keys and values. Attrs: TYPE = MACHINE DEPENDENT { name(1), rName(2), officeNumber(3), officeDDDNumber(4), outsideNumber(5), officeAddress(6), officeLocation(7), organization(8), homeAddress(9), frequency(10), mailSystem(11), primaryKey(12), (15) }; WhitePagesLookup: PROC[ wpState: WPState, name: ROPE, feep: BOOL_FALSE ] RETURNS [ listing: WPListing ]; WhitePagesEntry: PROC[ wpState: WPState, name: ROPE_NIL, key: ATOM_$officeNumber, feep: BOOL_FALSE, listing: WPListing_NIL ] RETURNS [fullRName: ROPE, entry: ROPE, newListing: WPListing]; WhitePagesEnter: PROC[wpState: WPState, listing: WPListing]; WhitePagesPrint: PUBLIC SAFE PROC[wpState: WPState, listing: WPListing]; NewListing: PROC RETURNS [ThNet.WPListing]; List: PROC[listing: ThNet.WPListing, key: ATOM, value: Rope.ROPE]; InitWhitePagesDatabase: PUBLIC SAFE PROC[ fileName: ROPE_NIL, extIntMapName: ROPE_NIL, accessOptions: FS.AccessOptions _ $read, howToComplain: VoiceUtils.WhereToReport_$System] RETURNS[wpState: WPState_NIL]; CloseWhitePagesDatabase: PUBLIC SAFE PROC[ wpState: WPState, howToComplain: VoiceUtils.WhereToReport_$System] RETURNS[ok: BOOL_TRUE]; PhoneMap: TYPE = LIST OF PhoneMapEntry; PhoneMapEntry: TYPE = RECORD [ pattern: ROPE, replacement: ROPE ]; HowToDial: PROC[phoneNumber: ROPE, ownExtension: ROPE_NIL] RETURNS [whatToDial: ROPE, isLocalExtension: BOOLEAN]; FeepName: PROC[rName: ROPE] RETURNS [feepName: ROPE]; }. ŒThNet.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, May 16, 1986 4:16:33 pm PDT Ephemeral and Persistent data base services for Thrush Thrush-wide system control parameters. Otherwise, only reported if LarkControl window up for this Lark and debug=TRUE Default values for ringing -- too device-dependent, but life is hard. Types * FeepName is the numeric string resulting from spelling out the RName on a DTMF pad: "Q" is presumed to live between "P" and "R" on the "7" key. "Z" is presumed to live after "Y" on the "9" key. All punctuation, digits, non-alphabetic keys are mapped to "1". WhitePages These functions provide access to Swinehart's cobby old BTree-based "White Pages" database. This one is assumed to be keyed and sorted by RName. They are at present only called by the RName diddling code; see same for usage. name must be in form rr.xxxxxxx Returns first listing for which name is a substring, case unimportant, of the listing Put in something new, or replace something old. This and the following provide a way to build database entries. Include an enumerator here, if anybody ends up wanting it outside the implementation. NIL for fileName or extIntMapName defaults to User Profile values Telephone number interpretation Swinehart, May 16, 1986 4:16:24 pm PDT Cedar 6.1 changes to: DIRECTORY, InitWhitePagesDatabase, CloseWhitePagesDatabase Κ„˜šœ ™ Icodešœ Οmœ1™<—Jšœ:™:J˜Jšœ6™6J˜šΟk ˜ J˜J˜ J˜J˜Jšœžœžœ˜Jšœžœ ˜Jšœ žœ˜"J˜J˜—Jšœžœ˜J˜Jšœ&™&J˜šžœžœžœ˜JšœžœΟc"˜2JšœžœŸ˜,JšœžœŸ7˜NšœžœžœŸ5˜XJšœJž™N—Jšœžœž˜J™EJšœžœžœŸ1˜JJšœ žœ˜Jšœžœ˜ Jšœžœ˜"Jšœ žœ˜J˜—šœžœžœ˜ J˜—™J˜Jšœ žœžœ˜"šœžœžœ˜JšœžœŸH˜[J˜JšœŸ/˜IJšœžœ Ÿ&˜;J˜JšœŸ4˜RJšœ žœ Ÿ*˜CJ˜Jšœžœ Ÿ2˜MJšœŸ6˜PJšœ žœŸ˜'JšœžœžœŸ/˜IJ˜JšœŸ@˜VJšœžœŸ˜@JšœžœžœŸ>˜QJ˜J™ƒJ˜—Jšžœžœžœ˜Jšœ žœŸ˜J˜J˜—J˜—™ J™JšœQ™QJšœ?™?JšœO™OJ˜š Οnœžœžœžœžœžœ˜hJšœ™J™U—J™š œžœ˜Jšœžœžœžœ˜:Jšœžœžœž˜(Jšœžœ žœ žœ˜@—J˜š œžœ'˜