4
* Provides a default version of the Tcl_AppInit procedure for use with
5
* applications built with Extended Tcl and Tk. This is based on the
6
* the UCB Tk file tkAppInit.c
8
*-----------------------------------------------------------------------------
9
* Copyright 1991-1993 Karl Lehenbauer and Mark Diekhans.
11
* Permission to use, copy, modify, and distribute this software and its
12
* documentation for any purpose and without fee is hereby granted, provided
13
* that the above copyright notice appear in all copies. Karl Lehenbauer and
14
* Mark Diekhans make no representations about the suitability of this
15
* software for any purpose. It is provided "as is" without express or
17
*-----------------------------------------------------------------------------
18
* $Id: tkXAppInit.c,v 3.1 1993/11/21 01:19:20 markd Exp $
19
*-----------------------------------------------------------------------------
20
* Copyright (c) 1993 The Regents of the University of California.
21
* All rights reserved.
23
* Permission is hereby granted, without written agreement and without
24
* license or royalty fees, to use, copy, modify, and distribute this
25
* software and its documentation for any purpose, provided that the
26
* above copyright notice and the following two paragraphs appear in
27
* all copies of this software.
29
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
30
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
31
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
32
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
35
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
36
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
37
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
38
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
42
static char rcsid[] = "$Header: /u/markd/tcl/develop/extended/tksrc/RCS/tkXAppInit.c,v 3.1 1993/11/21 01:19:20 markd Exp $ SPRITE (Berkeley)";
45
#include "tclExtend.h"
50
* The following variable is a special hack that allows applications
51
* to be linked using the procedure "main" from the Tk library. The
52
* variable generates a reference to "main", which causes main to
53
* be brought in from the library (and all of Tk and Tcl with it).
56
EXTERN int main _ANSI_ARGS_((int argc,
58
int *tclDummyMainPtr = (int *) main;
61
* The following variable is a special hack that insures the tcl
62
* version of matherr() is used when linking against shared libraries
63
* Only define if matherr is used on this system.
66
#if defined(DOMAIN) && defined(SING)
67
EXTERN int matherr _ANSI_ARGS_((struct exception *));
68
int *tclDummyMathPtr = (int *) matherr;
73
*----------------------------------------------------------------------
77
* This procedure performs application-specific initialization.
78
* Most applications, especially those that incorporate additional
79
* packages, will have their own version of this procedure.
82
* Returns a standard Tcl completion code, and leaves an error
83
* message in interp->result if an error occurs.
86
* Depends on the startup script.
88
*----------------------------------------------------------------------
93
Tcl_Interp *interp; /* Interpreter for application. */
97
main = Tk_MainWindow(interp);
100
* Call the init procedures for included packages. Each call should
103
* if (Mod_Init(interp) == TCL_ERROR) {
107
* where "Mod" is the name of the module.
110
if (TclX_Init(interp) == TCL_ERROR) {
113
if (TkX_Init(interp) == TCL_ERROR) {
118
* Call Tcl_CreateCommand for application-specific commands, if
119
* they weren't already created by the init procedures called above.
123
* Specify a user-specific startup file to invoke if the application
124
* is run interactively. Typically the startup file is "~/.apprc"
125
* where "app" is the name of the application. If this line is deleted
126
* then no user-specific startup file will be run under any conditions.
129
tcl_RcFileName = "~/.tclrc";