<> <> <> <<>> <> <<>> DIRECTORY RefID USING [ID], Rope USING [ROPE], RPC USING [Conversation]; LoganBerry: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; <> <> <<>> AttributeType: TYPE = ATOM; AttributeValue: TYPE = ROPE; Attribute: TYPE = RECORD[ type: AttributeType, value: AttributeValue ]; Entry: TYPE = LIST OF Attribute; <> LogID: TYPE = [0..255]; activityLog: LogID = FIRST[LogID]; -- default log for updates <> <> <<>> <> <<>> Cursor: TYPE = RefID.ID; CursorDirection: TYPE = {increasing, decreasing}; <> <> OpenDB: TYPE = RefID.ID; SchemaInfo: TYPE = RECORD[ dbName: ROPE, -- name of database schema file keys: LIST OF AttributeType, -- available indices, the primary key is listed first indexNames: LIST OF ROPE, -- names of index files logs: LIST OF LogID, -- logs comprising the database logNames: LIST OF ROPE -- names of log files ]; <<>> <" are deemed to contain schema information for the file named in the subsequent line of the DF file or at the end of the same line. The two types of schema entries are as follows:>> <<--> log >> <<--> index >> <<>> <> <<============================>> <<-- SampleDB.df Directory [Indigo]Backups>Top> SampleDB.df!3 12-Aug-85 13:16:12 PDT Directory [Indigo]Backups>SampleDB> --> log 0 readwrite Activity.log!2 12-Aug-85 12:07:24 PDT --> log 1 readonly Readonly.log!1 5-Aug-85 11:50:51 PDT --> index "Name" primary Name.index>> <<============================>> <> <> <<>> Conv: TYPE = RPC.Conversation; <> Error: ERROR [ec: ErrorCode, explanation: ROPE _ NIL]; ErrorCode: TYPE = ATOM; <> <<$BadSchema, -- the schema can not be parsed>> <<$CantOpenSchema, -- the schema file could not be opened>> <<$BadDBHandle, -- an invalid OpenDB handle was passed to some routine>> <<$BadCursor, -- an invalid cursor was passed to some routine>> <<$NoIndex, -- the key presented in a read or delete operation has no associated index>> <<$NoPrimaryKey, -- a new entry being written does not contain a primary key>> <<$ValueNotUnique, -- a new entry being written contains the same primary key value as an existing entry, or the value supplied for a delete does not uniquely specifiy an entry>> <<$CantOpenLog, -- a log file could not be opened>> <<$BadLogEntry, -- a log entry is of the wrong format>> <<$LogReadOnly, -- the specified log can not be updated>> <<$InvalidReplace, -- an entry being replaced is in a different log than its replacement >> <<$CantOpenIndex, -- a btree file could not be opened>> <<$BadIndex, -- a btree index is corrupted>> <<$DBClosed, -- the database has been closed>> <<$DBNotAvailable, -- the database has been taken out of general service>> <<$InternalError -- indicates some miscellaneous internal error>> Open: PROC [conv: Conv _ NIL, dbName: ROPE] RETURNS [db: OpenDB]; <> <> Describe: PROC [conv: Conv _ NIL, db: OpenDB] RETURNS [info: SchemaInfo]; <> <> ReadEntry: PROC [conv: Conv _ NIL, db: OpenDB, key: AttributeType, value: AttributeValue] RETURNS [entry: Entry, others: BOOLEAN]; <> <> EntryProc: TYPE = PROC [entry: Entry] RETURNS [continue: BOOL]; EnumerateEntries: PROC [db: OpenDB, key: AttributeType, start: AttributeValue _ NIL, end: AttributeValue _ NIL, proc: EntryProc] RETURNS []; <> <> <> GenerateEntries: PROC [conv: Conv _ NIL, db: OpenDB, key: AttributeType, start: AttributeValue _ NIL, end: AttributeValue _ NIL] RETURNS [cursor: Cursor]; <> <> <<>> NextEntry: PROC [conv: Conv _ NIL, cursor: Cursor, dir: CursorDirection _ increasing] RETURNS [entry: Entry]; <> <> EndGenerate: PROC [conv: Conv _ NIL, cursor: Cursor] RETURNS []; <> WriteEntry: PROC [conv: Conv _ NIL, db: OpenDB, entry: Entry, log: LogID _ activityLog, replace: BOOLEAN _ FALSE] RETURNS []; <> <> DeleteEntry: PROC [conv: Conv _ NIL, db: OpenDB, key: AttributeType, value: AttributeValue] RETURNS []; <> <> Close: PROC [conv: Conv _ NIL, db: OpenDB] RETURNS []; <> <> <> <> <> BuildIndices: PROC [conv: Conv _ NIL, db: OpenDB] RETURNS []; <> CompactLogs: PROC [conv: Conv _ NIL, db: OpenDB] RETURNS []; <> END. <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <<>>