This file implements set of commands and utilities to manage Tcl interpreter initialization for NaviServer. What all this stuff does is simple: synthetize a Tcl script used to initialize new Tcl interpreters.
There are basically two strategies:
Which one of the above 2 strategies is currently used by the server, is controlled by the "lazyloader" parameter of the Tcl library, as defined in the server configuration file. The A. strategy is selected by setting the parameter to false. The B. strategy is selected by setting the parameter to true.
In order to influence script generation, users can add their own tracing implementations. Tracers and other supporting callbacks for the following Tcl commands are provided per default:
load, namespace, variable, proc, rename
For the information of how to add new tracers please look into the source code of already provided callbacks.
Summary of commands:
nstrace::enabletrace activates registered Tcl command traces nstrace::disabletrace terminates tracing of Tcl commands nstrace::tracescript returns a script for initializing interps nstrace::enablestate activates generation of the state script nstrace::disablestate terminates generation of the state script nstrace::statescript returns a script for initializing interps nstrace::isactive returns true if tracing Tcl commands is on nstrace::config setup some configuration options nstrace::excludensp skip serializing the given namespace nstrace::namespaces returns list of namespaces for the given parent nstrace::addtrace registers custom tracer callback nstrace::addscript registers custom script generator nstrace::addresolver registers custom command resolver nstrace::enablecode returns signal about start of tracing nstrace::disablecode returns signal about stop of tracing nstrace::addentry adds one entry into the named trace store nstrace::getentry returns the entry value from the named store nstrace::delentry removes the entry from the named store nstrace::getentries returns all entries from the named store