2 // SWIG Interface file for building a new version of itclsh
11 This module provides a main() program needed to build a new version
12 of the [incr Tcl] 'itclsh' executable. It has been tested with itcl 2.1,
13 but may need tweaking for later versions and for use with C++.
22 * Provides a default version of the main program and Tcl_AppInit
23 * procedure for Tcl applications (without Tk).
25 * Copyright (c) 1993 The Regents of the University of California.
26 * Copyright (c) 1994-1995 Sun Microsystems, Inc.
28 * See the file "license.terms" for information on usage and redistribution
29 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
32 static char sccsid[] = "@(#) tclAppInit.c 1.13 95/06/08 10:55:54";
38 #ifndef SWIG_RcFileName
39 char *SWIG_RcFileName = "~/.tclshrc";
42 extern int Itcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
45 * The following variable is a special hack that is needed in order for
46 * Sun shared libraries to be used for Tcl.
49 extern int matherr _ANSI_ARGS_((void));
50 static int (*dummyMathPtr) _ANSI_ARGS_((void)) = matherr;
58 *----------------------------------------------------------------------
62 * This is the main program for the application.
65 * None: Tcl_Main never returns here, so this procedure never
69 * Whatever the application does.
71 *----------------------------------------------------------------------
76 int argc; /* Number of command-line arguments. */
77 char **argv; /* Values of command-line arguments. */
79 Tcl_Main(argc, argv, Tcl_AppInit);
80 return 0; /* Needed only to prevent compiler warning. */
84 *----------------------------------------------------------------------
88 * This procedure performs application-specific initialization.
89 * Most applications, especially those that incorporate additional
90 * packages, will have their own version of this procedure.
93 * Returns a standard Tcl completion code, and leaves an error
94 * message in interp->result if an error occurs.
97 * Depends on the startup script.
99 *----------------------------------------------------------------------
104 Tcl_Interp *interp; /* Interpreter for application. */
106 if (Tcl_Init(interp) == TCL_ERROR) {
111 * Call the init procedures for included packages. Each call should
114 * if (Mod_Init(interp) == TCL_ERROR) {
118 * where "Mod" is the name of the module.
121 if (Itcl_Init(interp) == TCL_ERROR) {
124 if (SWIG_init(interp) == TCL_ERROR) {
128 #if (TCL_MAJOR_VERSION > 7) || (TCL_MINOR_VERSION > 4)
129 Tcl_StaticPackage(interp, "Itcl", Itcl_Init, (Tcl_PackageInitProc *) NULL);
133 * Call Tcl_CreateCommand for application-specific commands, if
134 * they weren't already created by the init procedures called above.
138 * Specify a user-specific startup file to invoke if the application
139 * is run interactively. Typically the startup file is "~/.apprc"
140 * where "app" is the name of the application. If this line is deleted
141 * then no user-specific startup file will be run under any conditions.
144 #if (TCL_MAJOR_VERSION > 7) || (TCL_MINOR_VERSION > 4)
145 Tcl_SetVar(interp, "tcl_rcFileName", SWIG_RcFileName, TCL_GLOBAL_ONLY);
147 tcl_RcFileName = SWIG_RcFileName;