<> <> <> <> DIRECTORY CD, Rope, TokenIO; CDIO: CEDAR DEFINITIONS = BEGIN <<>> <> <<>> <<>> <<-- High level procedures >> <<>> ReadDesign: PROC [from: REF _ NIL, check: PROC [h: TokenIO.Handle] RETURNS [BOOL] _ NIL, wDir: Rope.ROPE _ NIL, stop: REF BOOL _ NIL] 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: BOOL _ FALSE, emergency: BOOL _ FALSE, stop: REF BOOL _ NIL, 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.ROPE_NIL, wDir: Rope.ROPE_NIL, modifier: Rope.ROPE_NIL] 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.