<> <> <> <<>> <> <<>> DIRECTORY RefID USING [ID, nullID], Rope USING [ROPE], LoganBerry; LoganQuery: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; <> QueryClass: TYPE = REF QueryClassRec; QueryClassRec: TYPE = RECORD [ flavor: ATOM _ NIL, -- name of cursor's class retrieve: RetrieveProc _ NIL, -- get next database entry destroy: DestroyProc _ NIL -- end the query (and destroy the cursor) ]; RetrieveProc: TYPE = PROC [cursor: ComplexCursor, dir: CursorDirection _ increasing] RETURNS [entry: LoganBerry.Entry]; <> DestroyProc: TYPE = PROC [cursor: ComplexCursor] RETURNS []; <> <> ComplexCursor: TYPE = RECORD [ class: QueryClass _ NIL, -- name of cursor's class data: RefID.ID _ RefID.nullID -- data slot for cursor class implementor ]; CursorDirection: TYPE = LoganBerry.CursorDirection; <> <> <<>> <> NextEntry: PROC [cursor: ComplexCursor, dir: CursorDirection _ increasing] RETURNS [entry: LoganBerry.Entry]; <> <> EndGenerate: PROC [cursor: ComplexCursor] RETURNS []; <> <> <<$Simple>> GenerateEntries: PROC [db: LoganBerry.OpenDB, key: LoganBerry.AttributeType, start: LoganBerry.AttributeValue _ NIL, end: LoganBerry.AttributeValue _ NIL] RETURNS [cursor: ComplexCursor]; <> <> <<>> <<$Filter>> FilterEntries: PROC [input: ComplexCursor, pattern: ROPE, filter: FilterProc, atype: LoganBerry.AttributeType, stopIfNothingGreater: BOOLEAN _ FALSE] RETURNS [output: ComplexCursor]; <> FilterProc: TYPE = PROC [value: ROPE, pattern: ROPE] RETURNS [match: BOOLEAN, nothingGreater: BOOLEAN _ FALSE]; <> <<$Merger>> MergeEntries: PROC [input1, input2: ComplexCursor, atype: LoganBerry.AttributeType] RETURNS [output: ComplexCursor]; <> <> Equal: FilterProc; <> Prefix: FilterProc; <> Wildcard: FilterProc; <> RE: FilterProc; <> Soundex: FilterProc; <> END. <> <> << >> <> <> <<>> <> <> <<>> <<>> <<>> <> <> <<>>