<> <> <> <> DIRECTORY CD USING [Technology], Commander USING [CommandProc], Icons USING [IconFlavor], Rope USING [ROPE], TIPUser USING [TIPTable]; CDEnvironment: CEDAR DEFINITIONS = BEGIN <> <<>> cdVersion: READONLY NAT; <<--The current ChipNDale release number>> <<--e.g. 28>> <<>> profilePrefix: READONLY Rope.ROPE; <<--Prefix for user profile options>> <<--e.g. "ChipNDale28.">> preRelease: READONLY BOOL; <<--Never ever make output with a pre-released version of ChipNDale >> <<--and try to read the files with a released version of ChipNDale. >> <<>> <<-- Tip tables >> SetTipTable: PROC [for: REF, tipTable: Rope.ROPE_NIL]; <<--Verbose on TerminalIO>> <<--for: Design, Technology or global>> <<--tipTable: NIL for standard lookup (user profile)>> GetTipTable: PROC [for: REF] RETURNS [TIPUser.TIPTable]; <<--for: Design, Technology or global>> <<-- Icons >> SetIcon: PROC [for: REF, file: Rope.ROPE, n: NAT]; <<--for: Design, Technology or global>> <<--Only new viewers might get the new icon>> GetIcon: PROC [for: REF] RETURNS [Icons.IconFlavor]; <<--for: Design, Technology or global>> SetPanelIcon: PROC [for: REF, file: Rope.ROPE, n: NAT]; <<--for: Design, Technology or global>> <<--Only new viewers might get the new icon>> GetPanelIcon: PROC [for: REF] RETURNS [Icons.IconFlavor]; <<--for: Design, Technology or global>> <<>> <<-- Working Directories >> SetWorkingDirectory: PROC [for: REF, wDir: Rope.ROPE_NIL]; <<--Sets the working directory of ChipNDale feature (not process)>> <<--for: Design, Technology, NIL for ChipNDale itself (dangerous)>> <<--wDir: if NIL: takes wDir from profile or process>> GetWorkingDirectory: PROC [for: REF_NIL] RETURNS [wDir: Rope.ROPE]; <<--Gets the working directory for a ChipNDale feature (not process) [in slash format]>> <<--design: Design, Technology or ChipNDale's global directory>> <<>> DoWithWDir: PROC [wDir: Rope.ROPE, proc: PROC]; <<--executes proc with wDir as current working directory for process >> <<>> <<>> <<-- Commander >> <<>> RegisterCommander: PROC [key: Rope.ROPE, proc: Commander.CommandProc _ NIL, doc: Rope.ROPE _ NIL, clientData: REF _ NIL, interpreted: BOOL _ TRUE, technology: CD.Technology _ NIL]; <<--Like Commander.Register, but also registers command with directory prefixes for >> <<--technology's and ChipNDale's global directory [in slash format] >> <<>> <<>> <<-- Names >> MakeName: PROC [base: Rope.ROPE, ext: Rope.ROPE_NIL, wDir: Rope.ROPE_NIL, modifier: Rope.ROPE_NIL] RETURNS [Rope.ROPE]; <<--Makes a full path 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.>> <<--No check whether file exist is made.>> <<>> FindFile: PROC [base: Rope.ROPE, ext: Rope.ROPE_NIL, for: REF_NIL] RETURNS [Rope.ROPE]; <<--Makes a full path filename and checks existence of file. >> <<--Returns NIL if file does not exist.>> <<>> <<-- Loader >> RemoveSpaces: PROC [line: Rope.ROPE] RETURNS [Rope.ROPE_NIL]; <<--Returns rope with spaces (and tabs) removed from both ends>> SplitLine: PROC [line: Rope.ROPE] RETURNS [key, rest: Rope.ROPE_NIL]; <<--Splits a line into a keyword and the rest >> <<--Returns>> <<-- key: keyword at beginning of line; >> <<-- (leading spaces and trailing separator [space or colon] removed)>> <<-- rest: rest of line (after separator)>> <<-- (leading spaces removed)>> <<>> FetchKeyLine: PROC [fileName: Rope.ROPE, key: Rope.ROPE] RETURNS [entry: Rope.ROPE]; <<--Searches for a line starting with key in file>> <<--Returns the rest of the line found or NIL if not found>> StuffToCommandTool: PROC [r: Rope.ROPE, wDir: Rope.ROPE_NIL, searchPath: LIST OF Rope.ROPE_NIL, catchErrors: BOOL_TRUE, continueErrors: BOOL_TRUE] RETURNS [result: REF_NIL]; <<--Executes r with a commandtool>> <<--catchErrors: allows to interactively debug on errors>> <<--continueErrors: continue after error or aborting the debugger>> ExecFileEntry: PROC [key: Rope.ROPE, technology: CD.Technology_NIL, modifier: Rope.ROPE_NIL, catchErrors: BOOL_TRUE, continueErrors: BOOL_TRUE]; <<--Checks whether a particular key is mentioned in a .CDLoadList file>> <<--if particular key is found, executes the rest of the line with a command tool>> <<--technology and modifier are used to make the name of the used .CDLoadList file>> <<--(using modifier .CDLoadList files for particular feature classes can be distinguished)>> <<--building of name for the .CDLoadList files:>> <<-- ChipNDale-CD.CDLoadList if {technology=NIL, modifier=NIL}>> <<-- ChipNDale-CD-modifier.CDLoadList if {technology=NIL, modifier#NIL}>> <<-- ChipNDale-technologyName.CDLoadList if {technology#NIL, modifier=NIL}>> <<-- ChipNDale-technologyName-modifier.CDLoadList if {technology#NIL, modifier#NIL}>> LoadTechnology: PROC [key: ATOM, name: Rope.ROPE] RETURNS [CD.Technology]; <<--Makes all the necessary messages if not loaded>> <<>> GetTechnology: PROC [hint: REF] RETURNS [CD.Technology]; <<--Returns technology given its name or key; NIL if not found.>> <<--[more friendly version of CD.GetTechnology, which requires a key]>> END.