<> <> <> <<>> <> <<>> DIRECTORY LoganBerry USING [Describe, SchemaInfo], LoganBerryExtras; LoganBerryExtrasImpl: CEDAR PROGRAM IMPORTS LoganBerry EXPORTS LoganBerryExtras ~ BEGIN OPEN LoganBerryExtras; Describe2: PUBLIC PROC [conv: Conv _ NIL, db: OpenDB] RETURNS [info: SchemaInfo] ~ { <> oldinfo: LoganBerry.SchemaInfo _ LoganBerry.Describe[conv, db]; info _ NEW[SchemaInfoRec]; info.dbName _ oldinfo.dbName; WHILE oldinfo.logs#NIL DO log: LogInfo _ NEW[LogInfoRec _ [id: oldinfo.logs.first, file: oldinfo.logNames.first]]; info.logs _ CONS[log, info.logs]; oldinfo.logs _ oldinfo.logs.rest; oldinfo.logNames _ oldinfo.logNames.rest; ENDLOOP; info.logs _ ReverseLogList[info.logs]; WHILE oldinfo.keys#NIL DO index: IndexInfo _ NEW[IndexInfoRec _ [key: oldinfo.keys.first, file: oldinfo.indexNames.first]]; info.indices _ CONS[index, info.indices]; oldinfo.keys _ oldinfo.keys.rest; oldinfo.indexNames _ oldinfo.indexNames.rest; ENDLOOP; info.indices _ ReverseIndexList[info.indices]; }; ReverseLogList: PROC [list: LIST OF LogInfo] RETURNS [LIST OF LogInfo] ~ { new, temp: LIST OF LogInfo _ NIL; UNTIL list = NIL DO temp _ list; list _ list.rest; temp.rest _ new; new _ temp; ENDLOOP; RETURN[new]; }; ReverseIndexList: PROC [list: LIST OF IndexInfo] RETURNS [LIST OF IndexInfo] ~ { new, temp: LIST OF IndexInfo _ NIL; UNTIL list = NIL DO temp _ list; list _ list.rest; temp.rest _ new; new _ temp; ENDLOOP; RETURN[new]; }; <<>> END. <> <> <> <> <> <> <<>> <<>>