ThNet.mesa
Last modified by D. Swinehart, July 23, 1984 1:33:30 pm PDT
Ephemeral and Persistent data base services for Thrush
DIRECTORY
BTree,
BTreeSimple,
BTreeVM,
FS,
Log USING [ WhereToReport ],
Rope USING [ ROPE ],
RefTab USING [ Ref ]
;
ThNet: CEDAR DEFINITIONS = {
Thrush-wide system control parameters.
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.
Otherwise, only reported if LarkControl window up for this Lark and debug=TRUE
autoGVUpdate: BOOLEAN←FALSE,
Default values for ringing -- too device-dependent, but life is hard.
ringsInvalid: BOOL←TRUE, -- set to cause recreation of standard ring tunes
tonesVolume: CARDINAL ← 2,
defaultRingVolume: CARDINAL ← 2,
subduedVolumeInterval: CARDINAL𡤁,
feepVolume: CARDINAL ← 0
];
Types
WPState: TYPE = REF WPStateRecord;
WPStateRecord:
TYPE =
RECORD [
wpTree: BTreeSimple.Tree,
wpFile: FS.OpenFile,
wpFeepTree: BTreeSimple.Tree,
wpFeepFile: FS.OpenFile,
wpDataVMFile: FS.OpenFile,
wpDataVM: BTreeVM.Handle,
wpDataVMLen: INT𡤀,
wpDataVMValid: BOOL←TRUE,
wpOpen: BOOL←FALSE
];
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)
};
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.
WhitePagesLookup:
PROC[ wpState: WPState, name:
ROPE, feep:
BOOL←
FALSE ]
RETURNS [ listing: WPListing ];
name must be in form rr.xxxxxxx
Returns first listing for which name is a substring, case unimportant, of the listing
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];
Put in something new, or replace something old.
WhitePagesPrint:
PUBLIC
SAFE
PROC[wpState: WPState, listing: WPListing];
Include an enumerator here, if anybody ends up wanting it outside the implementation.
InitWhitePagesDatabase:
PUBLIC
SAFE
PROC[
fileName: ROPE, accessOptions: FS.AccessOptions ← $read,
howToComplain: Log.WhereToReport←$System]
RETURNS[wpState: WPState←NIL];
Telephone number interpretation
HowToDial:
PROC[phoneNumber:
ROPE, ownExtension:
ROPE←
NIL]
RETURNS [whatToDial: ROPE, isLocalExtension: BOOLEAN];
FeepName: PROC[rName: ROPE] RETURNS [feepName: ROPE];
}.