DIRECTORY BasicTime USING [GMT, nullGMT], LoganBerry USING [Entry, OpenDB], RefID USING [nullID], Rope USING [ROPE], Thrush USING [EncryptionKey]; VoiceRopeDB: CEDAR DEFINITIONS = { Handle: TYPE = REF HandleRec; HandleRec: TYPE = RECORD [ voiceRopeDB: LoganBerry.OpenDB _ RefID.nullID, voiceInterestDB: LoganBerry.OpenDB _ RefID.nullID, voiceRopeDBName: Rope.ROPE, voiceInterestDBName: Rope.ROPE ]; TuneID: TYPE = INT; TuneList: TYPE = LoganBerry.Entry; Header: TYPE = LoganBerry.Entry; Interest: TYPE = LoganBerry.Entry; ID: TYPE = Rope.ROPE; VoiceRopeInfo: TYPE ~ RECORD[ vrID: ID _ NIL, -- unique ID of the voice rope length: INT _ -1, -- length of the voice rope (-1 denotes the whole thing) creator: Rope.ROPE _ NIL, -- an RName, e.g. "Terry.pa" timestamp: BasicTime.GMT _ BasicTime.nullGMT, -- time of creation struct: TuneList _ NIL -- the actual voice rope components ]; InterestInfo: TYPE ~ RECORD[ interestID: ID _ NIL, -- unique ID of the interest vrID: ID, -- unique ID of a voice rope class: Rope.ROPE, -- e.g. "TiogaVoice" refID: Rope.ROPE, -- e.g. "[Ivy]<>User>FileWithVoice.tioga" creator: Rope.ROPE _ NIL, -- actually an RName, e.g. "Terry.pa" timestamp: BasicTime.GMT _ BasicTime.nullGMT, -- time interest was registered data: Rope.ROPE _ NIL -- class-specific data ]; Error: ERROR [ec: ATOM, explanation: Rope.ROPE _ NIL]; Open: PROC [dbName: Rope.ROPE] RETURNS [handle: Handle _ NIL]; ReadVoiceRope: PROC [handle: Handle, ropeID: ID] RETURNS [header: Header, struct: TuneList]; WriteVoiceRope: PROC [handle: Handle, vr: VoiceRopeInfo] RETURNS [info: VoiceRopeInfo]; DeleteVoiceRope: PROC [handle: Handle, ropeID: ID]; AddInterest: PROC [handle: Handle, interest: InterestInfo] RETURNS [info: InterestInfo]; DropInterest: PROC [handle: Handle, interest: InterestInfo]; VoiceRopeContainingTune: PROC [handle: Handle, tune: INT] RETURNS [header: Header]; InterestInVoiceRope: PROC [handle: Handle, ropeID: ID] RETURNS [interest: Interest]; InterestForRef: PROC [handle: Handle, class: Rope.ROPE, refID: Rope.ROPE] RETURNS [interest: Interest]; EnumProc: TYPE = PROC [info: VoiceRopeInfo] RETURNS [continue: BOOLEAN _ TRUE]; EnumerateVoiceRopes: PROC [handle: Handle, start: ID _ NIL, proc: EnumProc]; InterestProc: TYPE = PROC [info: InterestInfo] RETURNS [continue: BOOLEAN _ TRUE]; EnumerateInterestClass: PROC [handle: Handle, class: Rope.ROPE, proc: InterestProc]; UnpackHeader: PROC [header: Header] RETURNS [info: VoiceRopeInfo]; UnpackInterest: PROC [interest: Interest] RETURNS [info: InterestInfo]; SimpleTuneList: PROC [tune: TuneID, start: INT, length: INT, key: Thrush.EncryptionKey] RETURNS [list: TuneList]; NextTuneOnList: PROC [list: TuneList] RETURNS [tune: TuneID, start: INT, length: INT, key: Thrush.EncryptionKey, rest: TuneList]; TuneListInterval: PROC [list: TuneList, start: INT _ 0, length: INT _ -1] RETURNS [new: TuneList]; }. ŒVoiceRopeDB.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Doug Terry, August 22, 1986 2:33:43 pm PDT Routines for storing voice ropes in a database and manipulating their structure. This interface is internal to the voice rope package. Basic database operations Most of the errors raised are identical to LoganBerry.Errors. Prepares the given database for service. Returns the structure of the given voice rope. Writes the voice rope information into the database. If vr.vrID = NIL then a unique ID will be generated and returned as info.vrID. Deletes the given voice rope (regardless of what interests may exist). Adds an entry to the interest database if a similar entry does not already exist. Removes an entry from the interest database. Queries and enumerations Returns a voice rope containing the given tune, if one exists. Returns an interest for the voice rope, if one exists. Returns an interest with the given class and refID, 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. Calls the enumeration procedure for every interest of the given class. Stops when proc returns FALSE or the end of the database is encountered. Obtaining information Clients of this interface should never attempt to directly access information in a Header or Interest entry. These routines are used to parse this information and return it in a client-usable form. Returns the information associated with a voice rope header. Returns the information associated with an interest entry. Voice rope structure The following routines allow clients to manipulate TuneLists without having to understand their internal representations. 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 interval. If the list contains intervals of unspecified length (-1) then the desired voice rope interval may not be determinable and an Error[$UnspecifiedInterval] is raised. Warning: this operation modifies the original list! Doug Terry, June 3, 1986 3:30:54 pm PDT Created internal DB interface. changes to: DIRECTORY, VoiceRopeDB, OpenDB, ReadVoiceRope, WriteVoiceRope, SimpleTuneList, NextTuneOnList, TuneListInterval Doug Terry, June 12, 1986 2:32:49 pm PDT Clarified the distinction between packed entries, such as Headers, and unpacked records, such as VocieRopeInfo. changes to: DIRECTORY, VoiceRopeDB, ReadVoiceRope, WriteVoiceRope, DeleteVoiceRope, AddInterest, DropInterest, VoiceRopeContainingTune, InterestInVoiceRope, InterestForRef, EnumProc, EnumerateVoiceRopes, EnumerateInterestClass, UnpackHeader, UnpackInterest, TuneListInterval Doug Terry, August 18, 1986 5:09:02 pm PDT Minor modifications to some procedure arguments and their types. changes to: DIRECTORY, VoiceRopeDB, SimpleTuneList, NextTuneOnList, TuneListInterval, WriteVoiceRope, AddInterest Doug Terry, August 22, 1986 2:33:43 pm PDT Changes to comments to clarify treatment of length = -1. changes to: , VoiceRopeDB, Error, WriteVoiceRope, TuneListInterval สœ˜šœ™Icodešœ ฯmœ1™™>—š กœžœžœžœžœ˜>J™(—K˜šก œžœžœ$˜\K™.—K˜šกœžœ%žœ˜WKšœ„™„—K˜šกœžœ˜3K™F—K˜šก œžœ*žœ˜XK™QK˜—šก œžœ*˜—K˜šกœžœžœžœ˜TK™6K™—š กœžœžœžœžœ˜gK™B—K˜Kš œ žœžœžœ žœžœ˜OK˜šกœžœžœžœ˜LK™า—K˜Kš œžœžœžœ žœžœ˜RK˜šกœžœžœ˜TK™——™K™ฦK˜šก œžœžœ˜BJ™>K™—šกœžœžœ˜GJ™<—K˜—™K™yK™š กœžœžœ žœžœ˜qK™4—K˜š กœžœžœžœ žœ-˜K™‘—K˜š กœžœžœžœžœ˜bKšœฆ™ฆ——Jšœ˜K™™'K™Kšœ ฯro™{—™(K™oKšœ ข†™’—™*K™@Kšœ ขe™q—™*K™8Kšœ ข6™B—K™K™—…— X€