diff options
author | Kevin B Kenny <kennykb@acm.org> | 2010-12-01 16:42:33 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2010-12-01 16:42:33 (GMT) |
commit | 921c2612861d68b7b4eee66736379431ac081f30 (patch) | |
tree | 47091361dfd1c093c24bb1dc06082c6dc469eaad /generic/tclMain.c | |
parent | 86b28e0c4b2444435a30d345b3fe26daaf9de126 (diff) | |
download | tcl-921c2612861d68b7b4eee66736379431ac081f30.zip tcl-921c2612861d68b7b4eee66736379431ac081f30.tar.gz tcl-921c2612861d68b7b4eee66736379431ac081f30.tar.bz2 |
merge
Diffstat (limited to 'generic/tclMain.c')
-rw-r--r-- | generic/tclMain.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c index 3e2e1da..4cb9c27 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMain.c,v 1.50.2.2 2010/09/30 02:48:06 kennykb Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.50.2.3 2010/12/01 16:42:36 kennykb Exp $ */ /** @@ -18,9 +18,14 @@ * TCL_ASCII_MAIN defined. This way both Tcl_Main and Tcl_MainExW * can be implemented, sharing the same source code. */ -#ifndef TCL_ASCII_MAIN -# undef UNICODE -# undef _UNICODE +#if defined(TCL_ASCII_MAIN) +# ifdef UNICODE +# undef UNICODE +# undef _UNICODE +# else +# define UNICODE +# define _UNICODE +# endif #endif #include "tclInt.h" @@ -265,7 +270,7 @@ Tcl_SourceRCFile( /*---------------------------------------------------------------------- * - * Tcl_Main -- + * Tcl_Main, Tcl_MainEx -- * * Main program for tclsh and most other Tcl-based applications. * @@ -282,13 +287,14 @@ Tcl_SourceRCFile( */ void -Tcl_Main( +Tcl_MainEx( int argc, /* Number of arguments. */ TCHAR **argv, /* Array of argument strings. */ - Tcl_AppInitProc *appInitProc) + Tcl_AppInitProc *appInitProc, /* Application-specific initialization * function to call after most initialization * but before starting to execute commands. */ + Tcl_Interp *interp) { Tcl_Obj *path, *resultPtr, *argvPtr, *commandPtr = NULL; const char *encodingName = NULL; @@ -296,12 +302,8 @@ Tcl_Main( int code, length, tty, exitCode = 0; Tcl_MainLoopProc *mainLoopProc; Tcl_Channel inChannel, outChannel, errChannel; - Tcl_Interp *interp; Tcl_DString appName; - Tcl_FindExecutable(argv[0]); - - interp = Tcl_CreateInterp(); Tcl_InitMemory(interp); /* @@ -650,8 +652,24 @@ Tcl_Main( Tcl_Release(interp); Tcl_Exit(exitCode); } + +#ifndef UNICODE +void +Tcl_Main( + int argc, /* Number of arguments. */ + TCHAR **argv, /* Array of argument strings. */ + Tcl_AppInitProc *appInitProc) + /* Application-specific initialization + * function to call after most initialization + * but before starting to execute commands. */ +{ + Tcl_FindExecutable(argv[0]); + Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp()); +} +#endif #ifndef TCL_ASCII_MAIN + /* *--------------------------------------------------------------- * |