2 // SWIG Interface file for building a new version of ish
11 This module provides a main() program needed to build a new version
12 of the [incr Tcl] 'ish' 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.
31 * SCCS: @(#) tclAppInit.c 1.17 96/03/26 12:45:29
35 * The following variable is a special hack that is needed in order for
36 * Sun shared libraries to be used for Tcl.
43 #ifndef SWIG_RcFileName
44 char *SWIG_RcFileName = "~/.tclshrc";
47 extern int matherr _ANSI_ARGS_((void));
48 static int (*dummyMathPtr) _ANSI_ARGS_((void)) = matherr;
55 extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
56 extern int Tclptest_Init _ANSI_ARGS_((Tcl_Interp *interp));
60 #if (TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION < 4)
62 * The following variable is a special hack that allows applications
63 * to be linked using the procedure "main" from the Tcl7.3 library. The
64 * variable generates a reference to "main", which causes main to
65 * be brought in from the library (and all of Tcl with it).
68 extern int main _ANSI_ARGS_((int argc, char **argv));
69 static int (*dummyMainPtr) _ANSI_ARGS_((int argc, char **argv)) = main;
74 *----------------------------------------------------------------------
78 * This is the main program for the application.
81 * None: Tcl_Main never returns here, so this procedure never
85 * Whatever the application does.
87 *----------------------------------------------------------------------
91 #ifdef _USING_PROTOTYPES_
92 main (int argc, /* Number of command-line arguments. */
93 char **argv) /* Values of command-line arguments. */
96 int argc; /* Number of command-line arguments. */
97 char **argv; /* Values of command-line arguments. */
100 Tcl_Main(argc, argv, Tcl_AppInit);
101 return 0; /* Needed only to prevent compiler warning. */
106 *----------------------------------------------------------------------
110 * This procedure performs application-specific initialization.
111 * Most applications, especially those that incorporate additional
112 * packages, will have their own version of this procedure.
115 * Returns a standard Tcl completion code, and leaves an error
116 * message in interp->result if an error occurs.
119 * Depends on the startup script.
121 *----------------------------------------------------------------------
125 #ifdef _USING_PROTOTYPES_
126 Tcl_AppInit (Tcl_Interp *interp) /* Interpreter for application. */
129 Tcl_Interp *interp; /* Interpreter for application. */
132 if (Tcl_Init(interp) == TCL_ERROR) {
135 if (SWIG_init(interp) == TCL_ERROR) {
140 * Call the init procedures for included packages. Each call should
143 * if (Mod_Init(interp) == TCL_ERROR) {
147 * where "Mod" is the name of the module.
151 * Call Tcl_CreateCommand for application-specific commands, if
152 * they weren't already created by the init procedures called above.
156 * Specify a user-specific startup file to invoke if the application
157 * is run interactively. Typically the startup file is "~/.apprc"
158 * where "app" is the name of the application. If this line is deleted
159 * then no user-specific startup file will be run under any conditions.
162 #if (TCL_MAJOR_VERSION > 7) || (TCL_MINOR_VERSION > 4)
163 Tcl_SetVar(interp, "tcl_rcFileName", SWIG_RcFileName, TCL_GLOBAL_ONLY);
165 tcl_RcFileName = SWIG_RcFileName;