<> <> <> DIRECTORY BTree, BTreeSimple, BTreeVM, FS, IO, Log USING [ WhereToReport ], Rope USING [ ROPE ], RefTab USING [ Ref ] ; LogDB: 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 logFileName: ROPE, 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 logStream: IO.STREAM, -- stream onto the data file indexed by the trees. 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. ]; <<* 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".>> 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) }; <> <<>> <> <> <> Lookup: PROC[ wpState: WPState, name: ROPE, feep: BOOL_FALSE ] RETURNS [ listing: WPListing ]; <> <> <<>> GetEntry: PROC[ wpState: WPState, name: ROPE_NIL, key: ATOM_$officeNumber, feep: BOOL_FALSE, listing: WPListing_NIL ] RETURNS [fullRName: ROPE, entry: ROPE, newListing: WPListing]; LogAndEnter: PROC[wpState: WPState, listing: WPListing]; <> PrintEntries: PUBLIC SAFE PROC[listing: WPListing]; NewListing: PROC RETURNS [WPListing]; <> List: PROC[listing: WPListing, key: ATOM, value: Rope.ROPE]; <> InitWhitePagesDatabase: PUBLIC SAFE PROC[ <> fileName: ROPE_NIL, logFileName: ROPE, extIntMapName: ROPE_NIL, accessOptions: FS.AccessOptions _ $read, howToComplain: Log.WhereToReport_$System] RETURNS[wpState: WPState_NIL]; CloseWhitePagesDatabase: PUBLIC SAFE PROC[ wpState: WPState, howToComplain: Log.WhereToReport_$System] RETURNS[ok: BOOL_TRUE]; }.