DIRECTORY CD, Rope, TokenIO; CDIO: CEDAR DEFINITIONS IMPORTS TokenIO = BEGIN ReadDesign: PROC [from: REF_NIL, check: PROC [CD.Design] RETURNS [BOOL] _ NIL, wDir: Rope.ROPE _ NIL] RETURNS [CD.Design]; WriteDesign: PROC [design: CD.Design, to: REF_NIL, quiet: BOOL _ FALSE, emergency: BOOL _ FALSE] RETURNS [done: BOOL]; SetWorkingDirectory: PROC [design: REF, wDir: Rope.ROPE]; GetWorkingDirectory: PROC [design: REF_NIL] RETURNS [wDir: Rope.ROPE]; MakeName: PROC [base: Rope.ROPE, ext: Rope.ROPE_NIL, wDir: Rope.ROPE_NIL, modifier: Rope.ROPE_NIL] RETURNS [Rope.ROPE]; MakeShortName: PROC [design: CD.Design] RETURNS [name: Rope.ROPE]; DesignInReadOperation: PROC [] RETURNS [CD.Design] = INLINE { RETURN [designInReadOperation] }; designInReadOperation: PRIVATE READONLY CD.Design; VersionKey: PROC [] RETURNS [INT] = INLINE { RETURN [versionKey] }; versionKey: PRIVATE READONLY INT; ReadOrientation: PROC [] RETURNS [orientation: CD.Orientation]; WriteOrientation: PROC [orientation: CD.Orientation] = INLINE { TokenIO.WriteInt[orientation]; }; ReadLayer: PROC [] RETURNS [CD.Layer]; WriteLayer: PROC [l: CD.Layer]; ReadObject: PROC [] RETURNS [CD.Object]; WriteObject: PROC [ob: CD.Object]; ReadInstance: PROC [] RETURNS [CD.Instance]; WriteInstance: PROC [ap: CD.Instance]; ReadInstanceList: PROC [] RETURNS [list: CD.InstanceList]; WriteInstanceList: PROC [list: CD.InstanceList]; ReadProperties: PROC [] RETURNS [props: CD.PropList]; WriteProperties: PROC [props: CD.PropList]; -- 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 PushFlag -- and a PopFlag END. ϊCDIO.mesa Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, August 24, 1983 3:10 pm last edited by Christian Jacobi, September 19, 1985 6:32:45 pm PDT IO based on TokenIO -- High level procedures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --from is either a IO.STREAM, a Rope.ROPE, or NIL --check: (called if non NIL), is called after technology and design-name is initialized -- read proceeds only if check returns TRUE --returns NIL if design not read in successfully --no viewer is opened --to is either a IO.STREAM, a Rope.ROPE, or NIL --if emergency, some locks are ignored, interactive input is skipped; you better --roll back after an emergency write is done -- Working directories and filenames ~~~~~~~~~~~~~~~~~~~~~~~ --design: Design, Technology or global; does not overwrite value given by user profile --design: Design, Technology or global --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 --tries to guess a good 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. -- returns version key of current read operation --all its children must have been written before ΚΖ˜codešœ ™ Kšœ Οmœ7™BKšœ-™-KšœC™C—K˜šΟk ˜ Kšœ˜—K˜šΠlnœžœž ˜Kšžœ ˜—Kšž˜K™šœ™K™—K™Kšœ8™8K™šΟn œžœžœžœ žœžœ žœžœžœ ž œžœžœ ˜zK™1KšœW™WKšœ-™-K™0Kšœ™K˜—š  œžœ žœ žœžœ žœžœ žœžœžœžœ˜vK™/KšœQ™QKšœ,™,K˜—K˜Kšœ<™