DIRECTORY CD, Rope, TokenIO; CDIO: CEDAR DEFINITIONS = BEGIN ReadDesign: PROC [from: REF _ NIL, check: PROC [h: TokenIO.Handle] RETURNS [BOOL] _ NIL, wDir: Rope.ROPE _ NIL, stop: REF BOOL _ NIL] RETURNS [CD.Design]; WriteDesign: PROC [design: CD.Design, to: REF _ NIL, quiet: BOOL _ FALSE, emergency: BOOL _ FALSE, stop: REF BOOL _ NIL, truth: BOOL _ TRUE] 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 [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]; 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]; END. ΜCDIO.mesa Copyright c 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 IO based on TokenIO -- High level procedures --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 --to is either a IO.STREAM, a Rope.ROPE, or NIL --truth: to allow future implementation of temporary IO -- Working directories and filenames --design: Design, Technology; does not overwrite value given by user profile --design: Design, Technology or NIL -- (NIL for working directory where ChipNDale was started) --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 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. --all its children must have been written before -- 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 ΚΊ˜codešœ ™ Kšœ Οmœ=™HKšœ5™5K™?—K˜šΟk ˜ Kšœ˜—K˜KšΠknœžœž œ˜Kšž˜K™šœ™K™—K™Kšœ™K™šΟn œžœžœžœ žœžœžœžœ žœžœžœžœžœžœžœ ˜šK™RKšœL™LKšœ,™,K™;Kšœ/™/Kšœ™K˜—š   œžœ žœ žœžœ žœžœ žœžœžœžœžœ žœžœžœžœ˜’KšΟc/™/Kš‘œ5™7K˜—K˜Kšœ%™%K˜š œžœ žœ žœ˜9Kš‘œ‘D™LK˜—š  œžœ žœžœ žœ˜FKš‘œ‘™#Kš‘œ‘7™:K™—š œžœ žœ žœžœ žœžœžœžœžœžœ˜wKšœJ™JKšœ=™=Kšœ™K™—š   œžœ žœ žœ žœ˜BKšœ>™>—K™K™Kšœ™K™K™BKšœ3™3K™NK™2K˜š œžœžœžœ ˜DK˜—Kš  œžœžœžœ˜3K˜Kš œžœžœžœ˜PKš œžœ"žœ˜HK˜Kš  œžœžœžœ˜7Kš  œžœžœ˜2K˜Kš  œžœžœžœ ˜9š  œžœžœ ˜5Kšœ0™0K˜—Kš  œžœžœžœ ˜=Kš  œžœžœ ˜;K˜Kš œžœžœ žœ ˜FKš œžœžœ ˜>K˜Kš œžœžœžœ ˜8Kš œžœžœ ˜3K˜Kš œžœžœžœ˜5Kš  œžœžœ˜0K˜Kšœ™K™]K™6K™XK™K˜Kšžœ˜K˜K˜—…—”