69 lines
2.7 KiB
Groff
69 lines
2.7 KiB
Groff
'\"
|
|
'\" Copyright (c) 1993 The Regents of the University of California.
|
|
'\" All rights reserved.
|
|
'\"
|
|
'\" Permission is hereby granted, without written agreement and without
|
|
'\" license or royalty fees, to use, copy, modify, and distribute this
|
|
'\" documentation for any purpose, provided that the above copyright
|
|
'\" notice and the following two paragraphs appear in all copies.
|
|
'\"
|
|
'\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
|
|
'\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
|
'\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
|
'\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
'\"
|
|
'\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
|
|
'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
'\" AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
|
'\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
|
|
'\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
'\"
|
|
'\" $Header: /user6/ouster/tcl/man/RCS/AppInit.3,v 1.2 93/06/07 15:11:46 ouster Exp $ SPRITE (Berkeley)
|
|
'\"
|
|
.so man.macros
|
|
.HS Tcl_AppInit tclc 7.0
|
|
.BS
|
|
.SH NAME
|
|
Tcl_AppInit \- Perform application-specific initialization
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\fB#include <tcl.h>\fR
|
|
.sp
|
|
\fBTcl_AppInit\fR(\fIinterp\fR)
|
|
.SH ARGUMENTS
|
|
.AS Tcl_Interp *interp
|
|
.AP Tcl_Interp *interp in
|
|
Interpreter for the application.
|
|
.BE
|
|
|
|
.SH DESCRIPTION
|
|
.PP
|
|
\fBTcl_AppInit\fR is a procedure that is invoked by the main programs
|
|
for Tcl applications such as \fBtclsh\fR and \fBwish\fR.
|
|
Its purpose is to allow new Tcl applications to be created without
|
|
modifying existing main programs such as those for \fBtclsh\fR
|
|
and \fBwish\fR.
|
|
To create a new application simply write a new version of
|
|
\fBTcl_AppInit\fR to replace the default version provided by Tcl,
|
|
then link your new \fBTcl_AppInit\fR with the Tcl library, which
|
|
contains the main program from \fBtclsh\fR (be sure to specify the
|
|
switch ``\fB\-u _main\fR'' to the linker to force it to use the
|
|
version of \fBmain\fR from the Tcl library).
|
|
.PP
|
|
\fBTcl_AppInit\fR is invoked after other initialization in
|
|
\fBmain\fR and before entering the main loop to process commands.
|
|
Here are some examples of things that \fBTcl_AppInit\fR might do:
|
|
.IP [1]
|
|
Call initialization procedures for various packages used by
|
|
the application.
|
|
Each initialization procedure adds new commands to \fIinterp\fR
|
|
for its package and performs other package-specific initialization.
|
|
.IP [2]
|
|
Process command-line arguments, which can be accessed from the
|
|
Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
|
|
.IP [3]
|
|
Invoke a startup script to initialize the application.
|
|
|
|
.SH KEYWORDS
|
|
application, argument, command, initialization, interpreter
|