CDIO.mesa
Copyright © 1983, 1986, 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, August 24, 1983 3:10 pm
Last edited by: Christian Jacobi, April 10, 1987 6:28:28 pm PDT
DIRECTORY
CD, Rope, TokenIO;
CDIO: CEDAR DEFINITIONS =
BEGIN
IO based on TokenIO
-- High level procedures
ReadDesign: PROC [from: REF NIL, check: PROC [h: TokenIO.Handle] RETURNS [BOOL] ← NIL, wDir: Rope.ROPENIL, stop: REF BOOLNIL] RETURNS [CD.Design];
--from is either a IO.STREAM, a Rope.ROPE, or NIL (for interactive filename query)
--check (if ~NIL): is called after technology and design-name is initialized
-- read proceeds only if check returns TRUE
--Returns design, or NIL if design not read in successfully
--Caller is supposed to set designs mutability.
--Does not open a viewer
WriteDesign: PROC [design: CD.Design, to: REF NIL, quiet: BOOLFALSE, emergency: BOOLFALSE, stop: REF BOOLNIL, truth: BOOL TRUE] RETURNS [done: BOOL];
--to is either a IO.STREAM, a Rope.ROPE, or NIL
--truth: to allow future implementation of temporary IO
-- Working directories and filenames
SetWorkingDirectory: PROC [design: REF, wDir: Rope.ROPE];
--design: Design, Technology; does not overwrite value given by user profile
GetWorkingDirectory: PROC [design: REF←NIL] RETURNS [wDir: Rope.ROPE];
--design: Design, Technology or NIL
--(NIL for working directory where ChipNDale was started)
MakeName: PROC [base: Rope.ROPE, ext: Rope.ROPENIL, wDir: Rope.ROPENIL, modifier: Rope.ROPENIL] RETURNS [Rope.ROPE];
--Makes a filename: adds extension ext if base does not have an extension;
--Adds working directory wDir if base is not a full path name
--Adds modifier if not NIL
MakeShortName: PROC [design: CD.Design] RETURNS [name: Rope.ROPE];
--Tries to guess a valid base part of file name for the design
-- Object implementors
-- The following routines serves for calls from implementations of
-- CD.InternalWriteProc's or CD.InternalReadProc';
-- They must not be called inside arbitrary computations where the appropriate
-- initializations and finalizations are not done.
DesignInReadOperation: PROC [h: TokenIO.Handle] RETURNS [CD.Design];
VersionKey: PROC [h: TokenIO.Handle] RETURNS [INT];
ReadOrientation: PROC [h: TokenIO.Handle] RETURNS [orientation: CD.Orientation];
WriteOrientation: PROC [h: TokenIO.Handle, orientation: CD.Orientation];
ReadLayer: PROC [h: TokenIO.Handle] RETURNS [CD.Layer];
WriteLayer: PROC [h: TokenIO.Handle, l: CD.Layer];
ReadObject: PROC [h: TokenIO.Handle] RETURNS [CD.Object];
WriteObject: PROC [h: TokenIO.Handle, ob: CD.Object];
--all its children must have been written before
ReadInstance: PROC [h: TokenIO.Handle] RETURNS [CD.Instance];
WriteInstance: PROC [h: TokenIO.Handle, inst: CD.Instance];
ReadProperties: PROC [h: TokenIO.Handle] RETURNS [props: CD.PropList];
WriteProperties: PROC [h: TokenIO.Handle, props: CD.PropList];
ReadPos: PROC [h: TokenIO.Handle] RETURNS [CD.Position];
WritePos: PROC [h: TokenIO.Handle, p: CD.Position];
ReadRect: PROC [h: TokenIO.Handle] RETURNS [CD.Rect];
WriteRect: PROC [h: TokenIO.Handle, r: CD.Rect];
-- Rules for IO:
-- Any Object is either bracketed with a TokenIO.PushFlag and a PopFlag, or it is represented
-- by a single INT, which references another object
-- Any Property starts with $Property followed by information bracketed with a PushFlag2
-- and a PopFlag
END.