]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxSWIG/swig_lib/tcl/tclsh.i
Updates for building wxSWIG on Linux
[wxWidgets.git] / wxPython / wxSWIG / swig_lib / tcl / tclsh.i
1 //
2 // $Header$
3 //
4 // SWIG File for building new tclsh program
5 // Dave Beazley
6 // April 25, 1996
7 //
8 /* Revision History
9 * $Log$
10 * Revision 1.1 2002/04/29 19:56:57 RD
11 * Since I have made several changes to SWIG over the years to accomodate
12 * special cases and other things in wxPython, and since I plan on making
13 * several more, I've decided to put the SWIG sources in wxPython's CVS
14 * instead of relying on maintaining patches. This effectivly becomes a
15 * fork of an obsolete version of SWIG, :-( but since SWIG 1.3 still
16 * doesn't have some things I rely on in 1.1, not to mention that my
17 * custom patches would all have to be redone, I felt that this is the
18 * easier road to take.
19 *
20 * Revision 1.1.1.1 1999/02/28 02:00:56 beazley
21 * Swig1.1
22 *
23 * Revision 1.1 1996/05/22 19:47:45 beazley
24 * Initial revision
25 *
26 */
27
28 #ifdef AUTODOC
29 %subsection "tclsh.i"
30 %text %{
31 This module provides the Tcl_AppInit() function needed to build a
32 new version of the tclsh executable. This file should not be used
33 when using dynamic loading. To make an interface file work with
34 both static and dynamic loading, put something like this in your
35 interface file :
36
37 #ifdef STATIC
38 %include tclsh.i
39 #endif
40 %}
41 #endif
42
43 %{
44
45 /* A TCL_AppInit() function that lets you build a new copy
46 * of tclsh.
47 *
48 * The macro SWIG_init contains the name of the initialization
49 * function in the wrapper file.
50 */
51
52 #ifndef SWIG_RcFileName
53 char *SWIG_RcFileName = "~/.myapprc";
54 #endif
55
56
57 #ifdef MAC_TCL
58 extern int MacintoshInit _ANSI_ARGS_((void));
59 #endif
60
61 int Tcl_AppInit(Tcl_Interp *interp){
62
63 if (Tcl_Init(interp) == TCL_ERROR)
64 return TCL_ERROR;
65
66 /* Now initialize our functions */
67
68 if (SWIG_init(interp) == TCL_ERROR)
69 return TCL_ERROR;
70 #if TCL_MAJOR_VERSION > 7 || TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 5
71 Tcl_SetVar(interp,"tcl_rcFileName",SWIG_RcFileName,TCL_GLOBAL_ONLY);
72 #else
73 tcl_RcFileName = SWIG_RcFileName;
74 #endif
75 #ifdef SWIG_RcRsrcName
76 Tcl_SetVar(interp,"tcl_rcRsrcName",SWIG_RcRsrcName,TCL_GLOBAL);
77 #endif
78
79 return TCL_OK;
80 }
81
82 #if TCL_MAJOR_VERSION > 7 || TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 4
83 int main(int argc, char **argv) {
84 #ifdef MAC_TCL
85 char *newArgv[2];
86
87 if (MacintoshInit() != TCL_OK) {
88 Tcl_Exit(1);
89 }
90
91 argc = 1;
92 newArgv[0] = "tclsh";
93 newArgv[1] = NULL;
94 argv = newArgv;
95 #endif
96
97 Tcl_Main(argc, argv, Tcl_AppInit);
98 return(0);
99
100 }
101 #else
102 extern int main();
103 #endif
104
105 %}
106