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,
serviceGuaranteedReservationTime: INT𡤃,
postIdleTimeout: NAT ← 10, -- in seconds (see ThPartyOpsImpl)
nullKeyCorrectParity: BOOL ← TRUE, -- bad key indices won't kill Lark
runLarkWatchDogTimer: BOOL ← TRUE, -- probe Larks at intervals
larkWatchDogTimerInterval: INT ← 1 -- per-Lark Interval, in seconds.
];
Types
ROPE: TYPE=Rope.ROPE;
WPListing: TYPE = LoganBerry.Entry; -- a list of keys and values.
WPState: TYPE = REF WPStateBody; -- a handle for the database.
WPStateBody:
TYPE =
RECORD [
db: LoganBerry.OpenDB←RefID.nullID,
dbName: ROPE,
howToComplain: VoiceUtils.WhereToReport←NIL
];
WhitePages
These functions provide access to a simple "White Pages"
database. This one is assumed to be keyed and sorted by RName and Name.
They are at present used primarily for access by RName diddling.
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];
If listing is provided, the appropriate field is extracted. Otherwise, a listing is first obtained from the database.
WhitePagesEnter:
PROC[wpState: WPState, listing: WPListing];
Put in something new, or replace something old.
WhitePagesPrint: PUBLIC SAFE PROC[wpState: WPState, listing: WPListing];
NewListing:
PROC
RETURNS [WPListing] =
INLINE {
RETURN[
NIL]; };
This and the following provide a way to build database entries.
List:
PROC[listing: WPListing, key:
ATOM, value: Rope.
ROPE];
Include an enumerator here, if anybody ends up wanting it outside the implementation.
InitWhitePagesDatabase:
PUBLIC
SAFE
PROC[
NIL for fileName defaults to User Profile values
fileName: ROPE←NIL, howToComplain: VoiceUtils.WhereToReport←$System]
RETURNS[wpState: WPState←NIL];
CloseWhitePagesDatabase:
PUBLIC
SAFE
PROC[
wpState: WPState, howToComplain: VoiceUtils.WhereToReport←$System]
RETURNS[ok: BOOL←TRUE];
}.