DIRECTORY CD, Rope, TokenIO; CDIO: CEDAR DEFINITIONS IMPORTS TokenIO = BEGIN ReadDesign: PROC [from: REF_NIL, check: PROC [CD.Design] RETURNS [BOOL] _ 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]; UseWorkingDirectory: 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.ObPtr]; WriteObject: PROC [ob: CD.ObPtr]; ReadApplicationPtr: PROC [] RETURNS [CD.ApplicationPtr]; WriteApplicationPtr: PROC [ap: CD.ApplicationPtr]; ReadApplicationList: PROC [] RETURNS [list: CD.ApplicationList]; WriteApplicationList: PROC [list: CD.ApplicationList]; ReadProperties: PROC [] RETURNS [props: CD.Properties]; WriteProperties: PROC [props: CD.Properties]; -- 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, April 11, 1985 2:39:27 pm PST -- 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 --viewer is not 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 --set (and returns) working directory for the running process --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 filename 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 Ê昚œ ™ Jšœ Ïmœ7™BJšœ-™-Jšœ?™?—J˜šÏk ˜ Jšœ˜J˜—šÏnœžœž ˜Jšžœ ˜—Jšž˜Jšœ™J™J™Jšœ8™8J™šŸ œžœžœžœ žœžœ žœžœžœžœžœ ˜cJ™1JšœW™WJšœ-™-J™0Jšœ™—J˜šŸ œžœ žœ žœžœ žœžœ žœžœžœžœ˜vJ™/JšœQ™QJšœ,™,—J˜J˜Jšœ<™™>Jš œ ™&—J™šŸœžœ žœ žœžœ žœžœžœžœžœžœ˜wJšœJ™JJšœ=™=Jšœ™J™—š Ÿ œžœ žœ žœ žœ˜BJšœ<™<—J™Jšœ8™8J™J™BJšœ3™3J™NJ™2J˜š Ÿœžœžœžœ žœ˜=Jšžœ˜J˜Jšœžœžœžœ˜2J˜—š Ÿ œžœžœžœžœ˜,Jšœ0™0Jšžœ ˜J˜Jšœ žœžœžœ˜!—J˜JšŸœžœžœžœ˜?šŸœžœžœžœ˜?Jšœ˜J˜—J˜JšŸ œžœžœžœ˜&JšŸ œžœžœ˜J˜JšŸ œžœžœžœ˜'šŸ œžœžœ˜!Jšœ0™0J˜—JšŸœžœžœžœ˜8JšŸœžœžœ˜2J˜Jš ŸœžœžœžœŸ˜@JšŸœžœžœ˜6J˜JšŸœžœžœ žœ ˜7JšŸœžœ žœ ˜-J˜Jšœ˜J˜]J˜6J˜WJ˜J˜Jšžœ˜J˜J˜—…—N’