DIRECTORY Core, CoreClasses, CoreDirectory, IO, RefTab; CoreIO: CEDAR DEFINITIONS = BEGIN UnknownProperty: SIGNAL [propKey: ATOM]; UnknownCellClass: SIGNAL [class: Core.CellClass]; SaveCellType: PROC [cellType: Core.CellType, fileName: Core.ROPE _ NIL]; ReportSaveCellType: PROC [cellType: Core.CellType, fileName: Core.ROPE _ NIL] RETURNS [props: LIST OF ATOM, classes: LIST OF Core.CellClass]; RestoreCellType: PROC [cellName: Core.ROPE _ NIL, fileName: Core.ROPE _ NIL] RETURNS [cellType: Core.CellType]; SaveLibrary: PROC [library: CoreDirectory.Library, fileName: Core.ROPE]; RestoreLibrary: PROC [fileName: Core.ROPE] RETURNS [library: CoreDirectory.Library]; RegisterClass: PROC [class: Core.CellClass, write: ClassWriteProc, read: ClassReadProc] RETURNS [sameClass: Core.CellClass]; ClassWriteProc: TYPE = PROC [stream: IO.STREAM, cellType: Core.CellType, wireIDTable: RefTab.Ref]; ClassReadProc: TYPE = PROC [stream: IO.STREAM, cellType: Core.CellType, wireIDTable: RefTab.Ref]; RegisterProperty: PROC [prop: ATOM, write: PropWriteProc, read: PropReadProc] RETURNS [sameProp: ATOM]; PropWriteProc: TYPE = PROC [stream: IO.STREAM, prop: ATOM, value: REF ANY]; PropReadProc: TYPE = PROC [stream: IO.STREAM, prop: ATOM] RETURNS [value: REF ANY]; WriteCellType: PROC [stream: IO.STREAM, cellType: Core.CellType]; ReadCellType: PROC [stream: IO.STREAM] RETURNS [cellType: Core.CellType]; WriteWire: PROC [stream: IO.STREAM, wireIDTable: RefTab.Ref, wire: Core.Wire]; ReadWire: PROC [stream: IO.STREAM, wireIDTable: RefTab.Ref] RETURNS [wire: Core.Wire]; WriteProperties: PROC [stream: IO.STREAM, properties: Core.Properties]; ReadProperties: PROC [stream: IO.STREAM] RETURNS [properties: Core.Properties _ NIL]; END. bCoreIO.mesa Copyright Σ 1985, 1987, 1988 by Xerox Corporation. All rights reserved. Barth, December 4, 1986 4:59:34 pm PST Bertrand Serlet May 5, 1988 3:14:33 pm PDT Mike Spreitzer February 27, 1987 2:43:27 pm PST Theory Do not put source information in .core or .corelib files! They are caches which may be flushed at any time! CoreIO is just a speed up for saving the result of some computation and reading it later without paying all of the cost of the computation again. Cell Type IO fileName=NIL => fileName _ Rope.Cat[CoreOps.GetCellTypeName[cellType], ".core"] UnknownProperty RESUME => Property is not written. UnknownCellClass RESUME => CoreOps.Recast. No recast proc => ERROR. Same as SaveCellType but catches unknown signals and returns a list of them when finished. fileName=NIL AND cellName=NIL => ERROR fileName=NIL => fileName _ Rope.Cat[cellName, ".core"] Unknown properties or cell classes => ERROR Always returns an imports Library IO .corelib is added to fileName .corelib is added to fileName Unknown properties or cell classes => ERROR Class Registration Property Registration IO Utilities Κ?˜codešœ ™ KšœH™HKšœ#Οk™&Kšœ*™*Kšœ,™/—K™š ˜ Kšœ"˜"Kšœ ˜ K˜—KšΟnœœ œ˜!head™IbodyšΟbl™lMšœ‘™‘—šœ ™ K˜Kšžœœ œ˜(šžœœ˜1K™—šž œœ*œœ˜HKšœ œC™OKšœœ™2Kšœœ'œ™DK˜—šžœœ*œœœ œœœ œœ˜JšœZ™ZK˜—šžœœœœœœœ˜oKšœ œœ œ™&Kšœ œ*™6Kšœ&™+K™——šœ™ šž œœ1œ˜HKšœ™K˜—šžœœœœ"˜TKšœ™Kšœ&™+——™šž œœEœ˜|K˜—š œœœ œœ4˜bK˜—Kš œœœ œœ4˜a—™š žœœœ,œ œ˜gK˜—šœœœ œœœ œœ˜KK˜—Kšœœœ œœœœ œœ˜S—šœ ™ Kšž œœ œœ˜Aš ž œœ œœœ˜IK˜—Kšž œœ œœ,˜Nš žœœ œœœ˜VK˜—Kšžœœ œœ˜Gš žœœ œœœ œ˜UK˜——Kšœ˜—…—Θi