To access the procedures in the Tcl library, an application should source the file init.tcl in the library, for example with the Tcl command
source [file join [info library] init.tcl]If the library procedure Tcl_Init is invoked from an application's Tcl_AppInit procedure, this happens automatically. The code in init.tcl will define the unknown procedure and arrange for the other procedures to be loaded on-demand using the auto-load mechanism defined below.
auto_mkindex foo *.tcl
will read all the .tcl files in subdirectory foo and generate a new index file foo/tclIndex.
Auto_mkindex parses the Tcl scripts by sourcing them into a slave interpreter and monitoring the proc and namespace commands that are executed. Extensions can use the (undocumented) auto_mkindex_parser package to register other commands that can contribute to the auto_load index. You will have to read through auto.tcl to see how this works.
Auto_mkindex_old parses the Tcl scripts in a relatively unsophisticated way: if any line contains the word proc as its first characters then it is assumed to be a procedure definition and the next word of the line is taken as the procedure's name. Procedure definitions that do not appear in this way (e.g. they have spaces before the proc) will not be indexed. If your script contains “dangerous” code, such as global initialization code or procedure names with special characters like $, *, [ or ], you are safer using auto_mkindex_old.
Auto_qualify is used by the auto-loading facilities in Tcl, both for producing auto-loading indexes such as pkgIndex.tcl, and for performing the actual auto-loading of functions at runtime.