HPUX AppInit[3]

Tcl_AppInit(3) Tcl Tcl_AppInit(3)
Tcl Library Procedures Tcl Library Procedures
7.0
___________________________________________________________________________
NAME
Tcl_AppInit - Perform application-specific initialization
SYNOPSIS
#include <tcl.h>
Tcl_AppInit(interp)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter for the application.
___________________________________________________________________________
DESCRIPTION
Tcl_AppInit is a procedure that is invoked by the main programs for
Tcl applications such as tclsh and wish. Its purpose is to allow new
Tcl applications to be created without modifying existing main
programs such as those for tclsh and wish. To create a new
application simply write a new version of Tcl_AppInit to replace the
default version provided by Tcl, then link your new Tcl_AppInit with
the Tcl library, which contains the main program from tclsh (be sure
to specify the switch ``-u _main'' to the linker to force it to use
the version of main from the Tcl library).
Tcl_AppInit is invoked after other initialization in main and before
entering the main loop to process commands. Here are some examples of
things that Tcl_AppInit might do:
[1] Call initialization procedures for various packages used by the
application. Each initialization procedure adds new commands to
interp for its package and performs other package-specific
initialization.
[2] Process command-line arguments, which can be accessed from the
Tcl variables argv and argv0 in interp.
[3] Invoke a startup script to initialize the application.
KEYWORDS
application, argument, command, initialization, interpreter
- 1 - Formatted: August 11, 1996