DIRECTORY BasicTime USING [GMT, earliestGMT, Now, Period, Update], Convert USING [IntFromRope, RopeFromInt], FS USING [ComponentPositions, ExpandName], IO USING [card, GetCard, GetInt, int, PutFR, RIS, rope, STREAM], LoganBerryStub USING [AttributeType, AttributeValue, Cursor, DeleteEntry, EndGenerate, Entry, Error, GenerateEntries, NextEntry, Open, OpenDB, ReadEntry, WriteEntry], Rope USING [Concat, Equal, Find, Replace, ROPE, Substr], Thrush USING [EncryptionKey, Tune, VoiceInterval], UserCredentials USING [CredentialsChangeProc, Get, RegisterForChange], VoiceRopeDB; VoiceRopeDBImpl: CEDAR PROGRAM -- Should this be a monitor? IMPORTS BasicTime, Convert, FS, IO, Rope, UserCredentials, LoganBerry: LoganBerryStub EXPORTS VoiceRopeDB ~ BEGIN OPEN VoiceRopeDB; ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; Error: PUBLIC ERROR [ec: ATOM, explanation: Rope.ROPE _ NIL] = CODE; Open: PUBLIC PROC[dbName: Rope.ROPE] RETURNS [handle: Handle _ NIL] = { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; vrDB, interestDB: ROPE; cp: FS.ComponentPositions; IF dbName = NIL THEN RETURN[NIL]; [vrDB, cp] _ FS.ExpandName[dbName]; IF cp.ext.length = 0 THEN vrDB _ Rope.Concat[vrDB, ".df"]; interestDB _ Rope.Replace[base: vrDB, start: cp.base.start+cp.base.length, len: 0, with: "Refs"]; handle _ NEW[HandleRec _ [voiceRopeDBName: vrDB, voiceInterestDBName: interestDB]]; handle.voiceRopeDB _ LoganBerry.Open[dbName: handle.voiceRopeDBName]; handle.voiceInterestDB _ LoganBerry.Open[dbName: handle.voiceInterestDBName]; }; ReadVoiceRope: PUBLIC PROC [handle: Handle, ropeID: ID] RETURNS [header: Header, struct: TuneList] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; header _ LoganBerry.ReadEntry[db: handle.voiceRopeDB, key: $VRID, value: ropeID].entry; struct _ EntryToTuneList[header]; }; WriteVoiceRope: PUBLIC PROC [handle: Handle, struct: TuneList] RETURNS [info: VoiceRopeInfo] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; entry: LoganBerry.Entry; interval: Thrush.VoiceInterval; list: TuneList; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; list _ struct; info.length _ 0; UNTIL list = NIL DO [interval: interval, rest: list] _ NextTuneOnList[list]; info.length _ info.length + interval.length; ENDLOOP; info.vrID _ GenerateUniqueID[]; info.creator _ UserCredentials.Get[].name; info.struct _ struct; entry _ PackHeader[info]; LoganBerry.WriteEntry[db: handle.voiceRopeDB, entry: entry ! LoganBerry.Error => IF ec = $ValueNotUnique THEN {info.vrID _ ReplaceID[entry]; RETRY}]; }; DeleteVoiceRope: PUBLIC PROC [handle: Handle, ropeID: ID] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; LoganBerry.DeleteEntry[db: handle.voiceRopeDB, key: $VRID, value: ropeID]; }; VoiceRopeContainingTune: PUBLIC PROC [handle: Handle, tune: INT] RETURNS [header: Header] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; header _ LoganBerry.ReadEntry[db: handle.voiceRopeDB, key: $TID, value: Convert.RopeFromInt[tune]].entry; }; EnumerateVoiceRopes: PUBLIC PROC [handle: Handle, start: ID _ NIL, proc: EnumProc] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; continue: BOOLEAN _ TRUE; entry: LoganBerry.Entry; info: VoiceRopeInfo; cursor: LoganBerry.Cursor; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; cursor _ LoganBerry.GenerateEntries[db: handle.voiceRopeDB, key: $VRID, start: start]; entry _ LoganBerry.NextEntry[cursor: cursor]; UNTIL entry = NIL OR NOT continue DO info _ UnpackHeader[entry]; continue _ proc[info]; entry _ LoganBerry.NextEntry[cursor: cursor]; ENDLOOP; LoganBerry.EndGenerate[cursor: cursor]; }; SimpleTuneList: PUBLIC PROC [tune: Thrush.Tune, interval: Thrush.VoiceInterval, key: Thrush.EncryptionKey] RETURNS [list: TuneList] ~ { list _ LIST[[$TID, Convert.RopeFromInt[tune]], [$Key, MarshalKey[key]], [$SL, MarshalInterval[interval]]]; }; NextTuneOnList: PUBLIC PROC [list: TuneList] RETURNS [tune: Thrush.Tune, interval: Thrush.VoiceInterval, key: Thrush.EncryptionKey, rest: TuneList] ~ { IF list = NIL THEN Error[$BadTuneList, "NIL tune list"]; tune _ Convert.IntFromRope[list.first.value]; key _ UnmarshalKey[list.rest.first.value]; interval _ UnmarshalInterval[list.rest.rest.first.value]; rest _ list.rest.rest.rest; }; EntryToTuneList: PROC [entry: LoganBerry.Entry] RETURNS [struct: TuneList] ~ { IF entry = NIL THEN RETURN[NIL]; UNTIL entry.first.type = $TID DO entry _ entry.rest; IF entry = NIL THEN Error[$BadTuneList, "No TID in entry"]; ENDLOOP; struct _ entry; }; TuneListInterval: PUBLIC PROC [list: TuneList, interval: Thrush.VoiceInterval] RETURNS [new: TuneList] ~ { tuneInterval: Thrush.VoiceInterval; -- the current tune's interval prevSamples: INT; -- number of samples in entry excluding the current tune interval samples: INT; -- number of samples in entry including the current tune interval intervalMustChange: BOOLEAN _ FALSE; IF list = NIL THEN RETURN[NIL]; IF interval.length = -1 THEN interval.length _ LAST[INT]; prevSamples _ 0; tuneInterval _ UnmarshalInterval[list.rest.rest.first.value]; samples _ tuneInterval.length; UNTIL samples > interval.start DO prevSamples _ samples; list _ list.rest.rest.rest; IF list = NIL THEN RETURN[NIL]; tuneInterval _ UnmarshalInterval[list.rest.rest.first.value]; samples _ samples + tuneInterval.length; ENDLOOP; new _ list; IF prevSamples # interval.start THEN { -- don't want first part of existing interval tuneInterval.start _ tuneInterval.start + interval.start - prevSamples; tuneInterval.length _ tuneInterval.length - (interval.start - prevSamples); intervalMustChange _ TRUE; }; IF (interval.length # LAST[INT]) AND (samples >= interval.start + interval.length) THEN { -- interval contained within a single tune interval tuneInterval.length _ interval.length; list.rest.rest.rest _ NIL; -- truncate list since we have has much as we need intervalMustChange _ TRUE; }; IF intervalMustChange THEN new.rest.rest.first.value _ MarshalInterval[tuneInterval]; IF (interval.length = LAST[INT]) OR (samples >= interval.start + interval.length) THEN -- no need to go on RETURN[new]; UNTIL samples >= interval.start + interval.length DO prevSamples _ samples; list _ list.rest.rest.rest; IF list = NIL THEN RETURN[new]; tuneInterval _ UnmarshalInterval[list.rest.rest.first.value]; samples _ samples + tuneInterval.length; ENDLOOP; IF samples # interval.start + interval.length THEN { -- want only first part of tune interval list.rest.rest.first.value _ MarshalInterval[[start: tuneInterval.start, length: interval.start + interval.length - prevSamples]]; }; list.rest.rest.rest _ NIL; -- truncate list since we have has much as we need RETURN[new]; }; PackHeader: PROC [info: VoiceRopeInfo] RETURNS [header: Header] ~ { entry: LoganBerry.Entry; entry _ info.struct; entry _ CONS[[$Length, Convert.RopeFromInt[info.length]], entry]; entry _ CONS[[$Creator, info.creator], entry]; entry _ CONS[[$VRID, info.vrID], entry]; RETURN[entry]; }; ReplaceID: PROC [header: Header] RETURNS [newID: ID] ~ { newID _ BadUniqueID[]; header.first.value _ newID; }; UnpackHeader: PUBLIC PROC [header: Header] RETURNS [info: VoiceRopeInfo] ~ { list: LoganBerry.Entry _ header; IF header = NIL THEN RETURN; info.vrID _ list.first.value; list _ list.rest; list _ list.rest; info.length _ Convert.IntFromRope[list.first.value]; [info.creator, info.timestamp] _ ParseUniqueID[info.vrID]; info.struct _ list.rest; }; AddInterest: PUBLIC PROC [handle: Handle, interest: InterestInfo] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; entry: LoganBerry.Entry _ NIL; oldEntry: LoganBerry.Entry; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; oldEntry _ ReadInterest[handle, interest.vrID, interest.class, interest.refID]; interest.interestID _ IF oldEntry = NIL THEN GenerateUniqueID[] ELSE oldEntry.first.value; entry _ PackInterest[interest]; LoganBerry.WriteEntry[db: handle.voiceInterestDB, entry: entry, replace: oldEntry # NIL ! LoganBerry.Error => IF ec = $ValueNotUnique AND oldEntry = NIL THEN {interest.interestID _ ReplaceInterestID[entry]; RETRY}]; }; DropInterest: PUBLIC PROC [handle: Handle, interest: InterestInfo] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; entry: LoganBerry.Entry; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; entry _ ReadInterest[handle, interest.vrID, interest.class, interest.refID]; IF entry = NIL THEN RETURN; LoganBerry.DeleteEntry[db: handle.voiceInterestDB, key: $IID, value: entry.first.value]; }; ReadInterest: PROC [handle: Handle, ropeID: ID _ NIL, class: Rope.ROPE _ NIL, refID: Rope.ROPE] RETURNS [entry: LoganBerry.Entry] ~ { info: InterestInfo; cursor: LoganBerry.Cursor _ LoganBerry.GenerateEntries[db: handle.voiceInterestDB, key: $RefID, start: refID, end: refID]; entry _ LoganBerry.NextEntry[cursor: cursor]; UNTIL entry = NIL DO info _ UnpackInterest[entry]; IF (ropeID = NIL OR Rope.Equal[info.refID, refID]) AND (class = NIL OR Rope.Equal[info.class, class]) THEN EXIT; entry _ LoganBerry.NextEntry[cursor: cursor]; ENDLOOP; LoganBerry.EndGenerate[cursor: cursor]; }; InterestForRef: PUBLIC PROC [handle: Handle, class: Rope.ROPE, refID: Rope.ROPE] RETURNS [interest: Interest] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; interest _ ReadInterest[handle: handle, class: class, refID: refID]; }; InterestInVoiceRope: PUBLIC PROC [handle: Handle, ropeID: ID] RETURNS [interest: Interest] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; interest _ LoganBerry.ReadEntry[db: handle.voiceInterestDB, key: $VRID, value: ropeID].entry; }; EnumerateInterestClass: PUBLIC PROC [handle: Handle, class: Rope.ROPE, proc: InterestProc] ~ { ENABLE LoganBerry.Error => ERROR Error[ec, explanation]; continue: BOOLEAN _ TRUE; entry: LoganBerry.Entry; info: InterestInfo; cursor: LoganBerry.Cursor; IF handle = NIL THEN Error[$BadHandle, "NIL handle"]; IF proc = NIL THEN Error[$NoProc, "No procedure passed to EnumerateInterestClass"]; cursor _ LoganBerry.GenerateEntries[db: handle.voiceInterestDB, key: $Class, start: class, end: class]; entry _ LoganBerry.NextEntry[cursor: cursor]; UNTIL entry = NIL OR NOT continue DO info _ UnpackInterest[entry]; continue _ proc[info]; entry _ LoganBerry.NextEntry[cursor: cursor]; ENDLOOP; LoganBerry.EndGenerate[cursor: cursor]; }; PackInterest: PUBLIC PROC [info: InterestInfo] RETURNS [interest: Interest] ~ { interest _ NIL; IF info.data # NIL THEN interest _ CONS[[$Data, info.data], interest]; interest _ CONS[[$RefID, info.refID], interest]; interest _ CONS[[$Class, info.class], interest]; interest _ CONS[[$VRID, info.vrID], interest]; interest _ CONS[[$IID, info.interestID], interest]; }; ReplaceInterestID: PROC [interest: Interest] RETURNS [newID: ID] ~ { newID _ BadUniqueID[]; interest.first.value _ newID; }; UnpackInterest: PUBLIC PROC [interest: Interest] RETURNS [info: InterestInfo] ~ { list: LoganBerry.Entry _ interest; IF interest = NIL THEN RETURN; info.interestID _ list.first.value; list _ list.rest; info.vrID _ list.first.value; list _ list.rest; info.class _ list.first.value; list _ list.rest; info.refID _ list.first.value; list _ list.rest; IF list # NIL THEN info.data _ list.first.value; [info.creator, info.timestamp] _ ParseUniqueID[info.interestID]; }; MarshalKey: PROC [key: Thrush.EncryptionKey] RETURNS [r: ROPE] ~ TRUSTED { cardKey: LONG POINTER TO ARRAY[0..2) OF LONG CARDINAL=LOOPHOLE [LONG[@key]]; r _ IO.PutFR["%bB %bB", IO.card[cardKey[0]], IO.card[cardKey[1]]]; }; UnmarshalKey: PROC [r: ROPE] RETURNS [key: Thrush.EncryptionKey] ~ TRUSTED { cardKey: LONG POINTER TO ARRAY[0..2) OF LONG CARDINAL=LOOPHOLE[LONG[@key]]; keyStream: IO.STREAM _ IO.RIS[r]; cardKey[0] _ IO.GetCard[keyStream]; cardKey[1] _ IO.GetCard[keyStream]; }; MarshalInterval: PROC [interval: Thrush.VoiceInterval] RETURNS [r: ROPE] ~ INLINE { r _ IO.PutFR["%g %g", IO.int[interval.start], IO.int[interval.length]]; }; UnmarshalInterval: PROC [r: ROPE] RETURNS [interval: Thrush.VoiceInterval] ~ INLINE { s: IO.STREAM _ IO.RIS[r]; interval.start _ IO.GetInt[s]; interval.length _ IO.GetInt[s]; }; userName: ROPE; counter: INT; kicks: INT; -- for instrumentation purposes GenerateUniqueID: PROC [] RETURNS [id: ROPE] ~ { timestamp: INT _ MAX[counter, BasicTime.Period[BasicTime.earliestGMT, BasicTime.Now[]]]; id _ IO.PutFR["%g#%g", IO.rope[userName], IO.int[timestamp]]; counter _ counter + 1; }; BadUniqueID: PROC [] RETURNS [id: ROPE] ~ { counter _ BasicTime.Period[BasicTime.earliestGMT, BasicTime.Now[]]+1; -- kick the counter kicks _ kicks + 1; id _ GenerateUniqueID[]; }; ParseUniqueID: PROC [id: ROPE] RETURNS [creator: ROPE, timestamp: BasicTime.GMT] ~ { seconds: INT; i: INT _ Rope.Find[s1: id, s2: "#"]; creator _ Rope.Substr[base: id, start: 0, len: i]; seconds _ Convert.IntFromRope[Rope.Substr[base: id, start: i+1]]; timestamp _ BasicTime.Update[BasicTime.earliestGMT, seconds]; }; NewUser: UserCredentials.CredentialsChangeProc ~ { userName _ UserCredentials.Get[].name; }; InitUniqueID: PROC [] RETURNS [] ~ { counter _ BasicTime.Period[BasicTime.earliestGMT, BasicTime.Now[]]; kicks _ 0; userName _ UserCredentials.Get[].name; UserCredentials.RegisterForChange[NewUser]; }; InitUniqueID[]; END. ่VoiceRopeDBImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Doug Terry, June 30, 1986 2:38:05 pm PDT Routines for storing voice ropes in a database and manipulating their structure. It is unresolved where a tune's encryption key should be stored. For now, it is kept with the tune interval; though this is the wrong place. It should probably be kept in the tune's header. Can't do that since FinchSmarts wants to be passed the key. VoiceRope database operations Voice ropes are stored in a LoganBerry database as a header followed by a list of tune intervals (a TuneList). Interests in voice ropes are also maintained in a LoganBerry database. Prepares the given database for service. The name of the interest database is derived from the voice rope database name by adding "Refs" after the base name. Returns the structure of the given voice rope. Writes the voice rope information into the LoganBerry database. compute length of voice rope will have to change how we get creator across RPC connection. Deletes the given voice rope (regardless of what interests may exist). Returns a voice rope containing the given tune, if one exists. Calls the enumeration procedure for every voice rope with id greater than start; start=NIL represents the first element of the database. Stops when proc returns FALSE or the end of the database is encountered. Voice rope structure WARNING: For efficiency reasons, much of this code relies on the exact structure of entries stored in a LoganBerry database. For instance, it assumes that the first attribute of an entry is a voice rope (or interest) ID and does not check the attribute type to verify this. Do NOT reorder attributes unless care is taken to change the code dependencies. A tune list, the structure of a voice rope, is represented in a LoganBerry database as an ordered list of $TID (the tune's ID), $Key (the tune's encryption key), and $SL (the start and length of a tune interval) attributes. The tune's encryption key should probably be kept in the tune's header, but that can't be done if FinchSmarts is used to record and play tunes. Builds a tune list with a single tune's information. Returns information about the next tune on the list; assumes that list really points to a properly structured TuneList so doesn't bother to check attribute types. The rest of the list is returned so this routine can be repetitively called to get all the tunes on the list. Returns the tune list representing the structure of the voice rope. Returns the tune list representing the structure of the voice rope interval. Warning: this operation modifies the original list! at this point: prevSamples <= interval.start < samples Note: there's a possibility that interval.start + interval.length could cause an integer overflow; do I want to pay the cost to check for this? at this point: prevSamples <= interval.start + interval.length <= samples the creator field is not really needed, but is included for compatibility with existing databases Returns the information associated with a voice rope header. ignore creator field Interests database Adds an entry to the interest database if a similar entry does not already exist. Removes an entry from the interest database. Searches for an entry with matching ropeID, class, and refID. Returns an interest with the given class and refID, if one exists. Returns an interest for the voice rope, if one exists. Calls the enumeration procedure for every interest of the given class. Stops when proc returns FALSE or the end of the database is encountered. Conversions (marshalling) Writes a start and length field into a rope. Parses the input rope into a start and length field. Generating unique identifiers A unique identifier is generated by concatenating a user's Rname with a timestamp. This assumes that the same user is not simultaneously creating voice ropes from two different workstations. This problem would not arise if machine names were used instead of user names. The technique used for obtaining the user's name will have to change when this code runs on the voice server instead of on client machines. The timestamp is taken to be the maximum of the current time (converted to an integer) and a simple counter. The current time alone is not sufficient since it has a granularity of seconds. Several voice ropes may be created within a second, but the long-term creation rate should be much less than one per second. The counter is initialized to the current time, which could cause some problems if this module is rerun before the current time has a chance to catch up to the old counter (or if a machine's clock is reset to an earlier time). This problem is detected by $ValueNotUnique errors from LoganBerry when one attempts to write a new voice rope. Note that the counter, as maintain by these routines, is sufficient as a unique ID if this code is run on the voice server. However, having a user's name and current timestamp as part of the permanent voice rope ID provides information that might be useful. This routine should be called if some generated ID does not turn out to be unique. It trys once again to generate a unique ID after advancing the counter. Initializations Doug Terry, June 3, 1986 4:19:14 pm PDT Extracted database operations from VoiceRopeImpl.mesa. changes to: VoiceRopeDBImpl , EXPORTS , ~ , WriteVoiceRope  Doug Terry, June 3, 1986 5:23:23 pm PDT changes to: VoiceRopeDBImpl, EXPORTS, ~, Open, WriteVoiceRope, END, DIRECTORY, IMPORTS, Read, SimpleTuneList, NextTuneOnList, TuneListInterval, EntryToTuneList Doug Terry, June 5, 1986 11:47:40 am PDT changes to: Open, Read, Write, EntryToTuneList, Error, DIRECTORY Doug Terry, June 5, 1986 3:07:30 pm PDT changes to: EntryToTuneList, TuneListInterval Doug Terry, June 10, 1986 5:55:22 pm PDT changes to: AddInterest, DropInterest, LookupInterest, Write, Delete, ~, LookupVoiceRope, LookupTune Doug Terry, June 11, 1986 3:40:47 pm PDT changes to: LookupTune, Enumerate, LookupVoiceRope, EnumerateInterests, ParseInterestEntry, AddInterest, DropInterest, LookupInterest, CRQuery, RCRQuery Doug Terry, June 12, 1986 4:45:50 pm PDT changes to: Open, ReadVoiceRope, EntryToTuneList, ~, WriteVoiceRope, PackHeader, ReplaceID, UnpackHeader, PackInterest, UnpackInterest, DeleteVoiceRope, VoiceRopeContainingTune, EnumerateVoiceRopes, AddInterest, DropInterest, ReplaceInterestID, ReadInterest, InterestForRef, InterestInVoiceRope, EnumerateInterestClass, BadUniqueID, ParseUniqueID, DIRECTORY Doug Terry, June 17, 1986 12:02:00 pm PDT changes to: UnpackHeader Doug Terry, June 26, 1986 2:08:18 pm PDT changes to: TuneListInterval Doug Terry, June 26, 1986 5:03:38 pm PDT changes to: Open, DIRECTORY, IMPORTS Doug Terry, June 30, 1986 1:11:17 pm PDT changes to: PackInterest Doug Terry, June 30, 1986 2:36:30 pm PDT changes to: UnpackHeader, Open, ReadVoiceRope, WriteVoiceRope, DeleteVoiceRope, VoiceRopeContainingTune, EnumerateVoiceRopes, AddInterest, DropInterest, InterestForRef, InterestInVoiceRope, EnumerateInterestClass, NextTuneOnList, EntryToTuneList, UnpackInterest สY˜codešœ™Kšœ ฯmœ1™Jšžœžœ˜8Kšžœ žœžœ!˜5Kšœj˜jK˜K˜—šกœž œžœžœ˜VK™าJšžœžœ˜8K–ซ[conv: LoganBerry.Conv _ NIL, db: LoganBerry.OpenDB, key: LoganBerry.AttributeType, start: LoganBerry.AttributeValue _ NIL, end: LoganBerry.AttributeValue _ NIL]šœ žœžœ˜Kšœ˜Kšœ˜Kšœ˜Kšžœ žœžœ!˜5KšœV˜VK–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-š žœ žœžœžœ ž˜$Kšœ˜Kšœ˜K–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-Kšžœ˜—Kšœ'˜'K˜——™Kšœไ™ไK™Jšœ๐™๐K˜šกœž œPžœ˜‡K™4Kšœžœ_˜jK˜K˜—šกœž œžœc˜—K™‘Kšžœžœžœ&˜8Kšœ-˜-Kšœ*˜*Kšœ9˜9K˜K˜K˜—šกœžœžœ˜NK™CKš žœ žœžœžœžœ˜ šžœžœ˜!Kšœ˜Kšžœ žœžœ(˜;Kšžœ˜—Kšœ˜K˜K™—šกœž œ2žœ˜jK™Kšœ% ˜CKšœ žœ A˜TKšœ žœ A˜PKšœžœžœ˜$Kš žœžœžœžœžœ˜Kšžœžœžœžœ˜9Kšœ˜Kšœ=˜=Kšœ˜šžœž˜!Kšœ˜Kšœ˜Kš žœžœžœžœžœ˜Kšœ=˜=Kšœ(˜(Kšžœ˜—Kšœ6™6Kšœ ˜ šžœžœ -˜UKšœG˜GKšœK˜KKšœžœ˜K˜—Kšœ™š žœžœžœžœ/žœ 3˜Kšœ&˜&Kšœžœ 2˜NKšœžœ˜K˜—šžœžœ˜Kšœ:˜:—š žœžœžœžœ/žœ ˜jKšžœ˜ —šžœ-ž˜4Kšœ˜Kšœ˜Kšžœžœžœžœ˜Kšœ=˜=Kšœ(˜(Kšžœ˜—KšœI™Išžœ,žœ (˜^Kšœ‚˜‚K˜—Kšœžœ 2˜NKšžœ˜ K˜—K˜šก œžœžœ˜CK˜Kšœ˜Kšœžœ5˜AK™aKšœžœ#˜/Kšœžœ˜(Kšžœ˜K˜—K˜šก œžœžœ žœ˜8Kšœ˜Kšœ˜K˜—K˜šก œžœžœžœ˜LJ™>Kšœ ˜ Kšžœ žœžœžœ˜Kšœ˜Kšœ˜Kšœ™Kšœ˜Kšœ4˜4Kšœ:˜:Kšœ˜K˜——™šก œž œ-˜EK™QJšžœžœ˜8Kšœžœ˜Kšœ˜Kšžœ žœžœ!˜5KšœO˜OKš œžœ žœžœžœ˜ZKšœ˜Kš œTžœžœžœ žœžœ2žœ˜ืK˜K˜—šก œž œ-˜FK™,Jšžœžœ˜8Kšœ˜Kšžœ žœžœ!˜5KšœL˜LKšžœ žœžœžœ˜KšœX˜XK˜K˜—š ก œžœžœž œžœžœ˜…Kšœ=™=Kšœ˜Kšœz˜zK–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-šžœ žœž˜Kšœ˜Kšžœ žœžœ žœ žœžœ žœžœ˜pK–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-Kšžœ˜—Kšœ'˜'K˜K˜—š กœž œžœžœžœ˜qK™BJšžœžœ˜8Kšžœ žœžœ!˜5KšœD˜DK˜K˜—šกœž œžœžœ˜^K™6Jšžœžœ˜8Kšžœ žœžœ!˜5Kšœ^˜^K˜K˜—šกœž œžœ˜^K™Jšžœžœ˜8K–ซ[conv: LoganBerry.Conv _ NIL, db: LoganBerry.OpenDB, key: LoganBerry.AttributeType, start: LoganBerry.AttributeValue _ NIL, end: LoganBerry.AttributeValue _ NIL]šœ žœžœ˜Kšœ˜Kšœ˜Kšœ˜Kšžœ žœžœ!˜5KšžœžœžœA˜SKšœg˜gK–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-š žœ žœžœžœ ž˜$Kšœ˜Kšœ˜K–l[conv: LoganBerry.Conv _ NIL, cursor: LoganBerry.Cursor, dir: LoganBerry.CursorDirection _ increasing]šœ-˜-Kšžœ˜—Kšœ'˜'K˜K˜—šก œž œžœ˜OKšœ žœ˜šžœ žœž˜Kšœ žœ˜.—Kšœ žœ!˜0Kšœ žœ!˜0Kšœ žœ˜.Kšœ žœ$˜3K˜—K˜šกœžœžœ žœ˜DKšœ˜Kšœ˜K˜K˜—šกœž œžœ˜QKšœ"˜"Kšžœ žœžœžœ˜Kšœ#˜#Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜šžœžœž˜Kšœ˜—Kšœ@˜@K˜K˜——™š ก œžœžœžœžœ˜JJšœ žœžœžœžœžœžœžœžœžœ˜LJšœžœžœžœ˜BK˜K˜—š ก œžœžœžœžœ˜LJšœ žœžœžœžœžœžœžœžœžœ˜KJš œ žœžœžœžœ˜!Jšœ žœ˜#Jšœ žœ˜#K˜K˜—š กœžœ"žœžœžœ˜SK™,KšœG˜GK˜K™—š กœžœžœžœ$žœ˜UK™4Kšœ˜Kšœ˜Kšœ˜K˜K™——™Kšœ‘ฯz‹™œK™Kšœ™K™Kšœ‚™‚K˜Kšœ žœ˜Kšœ žœ˜ Kšœžœ ˜,K˜šกœžœžœžœ˜0Kšœ žœžœD˜XKšœ=˜=K˜K˜—K˜šก œžœžœžœ˜+K™›KšœG ˜ZK˜Kšœ˜K˜—K˜š ก œžœžœžœ žœžœ˜TK–>[s1: ROPE, s2: ROPE, pos1: INT _ 0, case: BOOL _ TRUE]šœ žœ˜ Kšœžœ˜$Kšœ2˜2KšœA˜AKšœ=˜=K˜—K˜šกœ+˜2Kšœ&˜&K˜—K˜šก œžœžœ˜$KšœC˜CK˜ Kšœ&˜&Kšœ+˜+K˜——™Kšœ˜K™—K˜Kšžœ˜K™™'K™6Kš œ ฯrœฃ œฃœฃœฃ™C—™'Kšœ ฃ“™Ÿ—™(Kšœ ฃ4™@—™'Kšœ ฃ!™-—™(Kšœ ฃX™d—K™K™K™K™™(Kšœ ฃŒ™˜—K™K™K™™(Kšœ ฃู™ๅ—K™K™K™K™K™™)Kšœ ฃ ™—™(Kšœ ฃ™—™(Kšœ ฃ™$—K™K™™(Kšœ ฃ ™—™(Kšœ ฃ๙™…—K™K™K™—…—4”dี