<> <> <> <<>> <> <<>> DIRECTORY RefID USING [ID, nullID], Rope USING [ROPE], LoganBerryStub; 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: LoganBerryStub.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 = LoganBerryStub.CursorDirection; <> <> <<>> <> NextEntry: PROC [cursor: ComplexCursor, dir: CursorDirection _ increasing] RETURNS [entry: LoganBerryStub.Entry]; <> <> EndGenerate: PROC [cursor: ComplexCursor] RETURNS []; <> <> <<$Simple>> GenerateEntries: PROC [db: LoganBerryStub.OpenDB, key: LoganBerryStub.AttributeType, start: LoganBerryStub.AttributeValue _ NIL, end: LoganBerryStub.AttributeValue _ NIL] RETURNS [cursor: ComplexCursor]; <> <> <<>> <<$Filter>> FilterEntries: PROC [input: ComplexCursor, pattern: ROPE, filter: FilterProc, atype: LoganBerryStub.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: LoganBerryStub.AttributeType] RETURNS [output: ComplexCursor]; <> <> Equal: FilterProc; <> Prefix: FilterProc; <> Wildcard: FilterProc; <> RE: FilterProc; <> Soundex: FilterProc; <> END. <> <> <> <> <> <> <> <>