CoreIO.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Barth, May 6, 1986 1:19:14 pm PDT
DIRECTORY
Core, CoreClasses, HashTable;
CoreIO: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE = Core.ROPE;
Cell Type IO
SaveCellType: PROC [cellType: Core.CellType, fileName: ROPENIL];
fileName=NIL => fileName ← Rope.Cat[CoreOps.GetCellTypeName[cellType], ".core"]
RestoreCellType: PROC [cellName: ROPENIL, fileName: ROPENIL] RETURNS [cellType: Core.CellType];
fileName=NIL AND cellName=NIL => ERROR
fileName=NIL => fileName ← Rope.Cat[cellName, ".core"]
IO Registration
RegisterClass: PROC [class: Core.CellClass, write: ClassWriteProc, read: ClassReadProc];
ClassWriteProc: TYPE = PROC [h: Handle, cellType: Core.CellType, wireID: HashTable.Table];
ClassReadProc: TYPE = PROC [h: Handle, cellType: Core.CellType, wireID: HashTable.Table];
RegisterProperty: PROC [prop: ATOM, write: PropWriteProc, read: PropReadProc];
PropWriteProc: TYPE = PROC [h: Handle, prop: ATOM, val: REF ANY];
PropReadProc: TYPE = PROC [h: Handle, prop: ATOM] RETURNS [val: REF ANY];
Handle: TYPE = REF HandleRec;
HandleRec: TYPE = RECORD[
stream: Core.STREAMNIL,
cellTypeIDTab: HashTable.Table ← NIL,
nextCellTypeID: INT ← 0,
ropeIDTab: HashTable.Table ← NIL,
nextRopeID: INT ← 0];
On write cellTypeIDTab maps REF to ROPE. On read cellTypeIDTab maps ROPE to REF.
END.