- Tcl_Interp *interp (in)
Interpreter for the application.
Tcl_AppInit() is a hook procedure that is
the main programs for Tcl applications such as tclsh and
Its purpose is to allow new Tcl applications to be created without
modifying the main programs provided as part of Tcl and Tk.
To create a new application you write a new version of
Tcl_AppInit() to replace the default version provided by
then link your new Tcl_AppInit() with the Tcl library.
Tcl_AppInit() is invoked after by
Tcl_Main() and Tk_Main
after their own initialization and before entering the main loop
to process commands.
Here are some examples of things that Tcl_AppInit() might
Call initialization procedures for various packages used by
Each initialization procedure adds new commands to interp
for its package and performs other package-specific initialization.
Process command-line arguments, which can be accessed from the
Tcl variables argv and argv0 in interp.
Invoke a startup script to initialize the application.
Tcl_AppInit() returns TCL_OK or
If it returns TCL_ERROR then it must leave an error message in
for the interpreter's result; otherwise the result is ignored.
In addition to Tcl_AppInit(), your application should also
a procedure main that calls Tcl_Main() as
Tcl_Main(argc, argv, Tcl_AppInit);
The third argument to Tcl_Main() gives the address of the
application-specific initialization procedure to invoke.
This means that you don't have to use the name
for the procedure, but in practice the name is nearly always
Tcl_AppInit() (in versions before Tcl 7.4 the name
was implicit; there was no way to specify the procedure explicitly).
The best way to get started is to make a copy of the file
tclAppInit.c from the Tcl library or source directory.
It already contains a main procedure and a template for
Tcl_AppInit() that you can modify for your application.
Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.4 Documentation Build 39.