4 * Provides a default version of the Tcl_AppInit procedure for use with
5 * applications built with Extended Tcl and Tk on Unix systems. This is based
6 * on the the UCB Tk file tkAppInit.c
7 *-----------------------------------------------------------------------------
8 * Copyright 1991-1996 Karl Lehenbauer and Mark Diekhans.
10 * Permission to use, copy, modify, and distribute this software and its
11 * documentation for any purpose and without fee is hereby granted, provided
12 * that the above copyright notice appear in all copies. Karl Lehenbauer and
13 * Mark Diekhans make no representations about the suitability of this
14 * software for any purpose. It is provided "as is" without express or
16 *-----------------------------------------------------------------------------
18 *-----------------------------------------------------------------------------
21 #include "tclExtend.h"
25 * The following variable is a special hack that insures the tcl
26 * version of matherr() is used when linking against shared libraries
27 * Even if matherr is not used on this system, there is a dummy version
30 EXTERN int matherr ();
31 int (*tclDummyMathPtr)() = matherr;
34 /*-----------------------------------------------------------------------------
37 * This is the main program for the application.
38 *-----------------------------------------------------------------------------
52 TkX_Main(argc, argv, Tcl_AppInit);
54 Tk_Main(argc, argv, Tcl_AppInit);
56 return 0; /* Needed only to prevent compiler warning. */
59 /*-----------------------------------------------------------------------------
62 * This procedure performs application-specific initialization. Most
63 * applications, especially those that incorporate additional packages, will
64 * have their own version of this procedure.
67 * Returns a standard Tcl completion code, and leaves an error message in
68 * interp->result if an error occurs.
69 *-----------------------------------------------------------------------------
73 Tcl_AppInit (Tcl_Interp *interp)
80 if (Tcl_Init (interp) == TCL_ERROR) {
84 if (Tclx_Init(interp) == TCL_ERROR) {
87 Tcl_StaticPackage(interp, "Tclx", Tclx_Init, Tclx_SafeInit);
89 if (Tk_Init(interp) == TCL_ERROR) {
92 Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *) NULL);
94 if (Tkx_Init(interp) == TCL_ERROR) {
97 Tcl_StaticPackage(interp, "Tkx", Tkx_Init, (Tcl_PackageInitProc *) NULL);
100 if (Ldaptcl_Init(interp) == TCL_ERROR) {
103 Tcl_StaticPackage(interp, "Ldaptcl", Ldaptcl_Init,
104 (Tcl_PackageInitProc *) NULL);
107 * Call Tcl_CreateCommand for application-specific commands, if
108 * they weren't already created by the init procedures called above.
112 * Specify a user-specific startup file to invoke if the application
113 * is run interactively. Typically the startup file is "~/.apprc"
114 * where "app" is the name of the application. If this line is deleted
115 * then no user-specific startup file will be run under any conditions.
117 Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishxrc", TCL_GLOBAL_ONLY);