tcRegPreLoadTrigger
tcRegPreLoadTrigger(s_function[x_priority] ) => t / nil
Description
Registers a trigger function the system calls before loading a technology database. The s_function argument is a SKILL procedure with two arguments: the database identifier of the technology database and the name of the ASCII technology file you are loading. Trigger functions are called in order of priority, with 0 having the highest priority. If you do not specify a priority argument, the default is the lowest priority (that is, it executes after any other trigger function that specifies a priority).
You can use this function to check the technology file contents before loading the technology file. Library administrators can use this mechanism to prevent library users from accidentally overwriting technology data that must be consistent with the centrally defined technology data.
Arguments
|
Symbol indicating the name of the trigger function. The format of the function is as follows: |
|
Value Returned
|
The SKILL procedure does not exist or is incomplete; the trigger function did not register. |
Example
procedure(MYFilterTechFileLoad( TFID techfile) prog((techport) if(TFID~>owner != "sysAdmin" return(t))
; TFID is owned by central admintrator.
; Do not allow user to overwrite protected
; technology data.
techport = infile(techfile)
; Read file into big list then check the
; section headers.
while((section = read(techport))
if( listp(section) && memq(car(section)
MYProtectedSections) then
warn("Cannot load techfile containing
\"%s\" section" car(section))
close (techport)
return(nil)
)
)
close(techport)
return(t)
)
)
tcRegPreLoadTrigger(’MYFilterTechFileLoad)
Registers a preload trigger that prevents a user from accidentally overwriting the technology data defined by the library owner.
Return to top