summaryrefslogtreecommitdiffstats
path: root/unix/tkAppInit.c
diff options
context:
space:
mode:
authorredman <redman>1999-12-02 02:05:31 (GMT)
committerredman <redman>1999-12-02 02:05:31 (GMT)
commit47db144ca5053ea42c75249d1269230a1f3eb8fa (patch)
treeed0a121bdb6db0a3a36b7cd89a95be74a4409332 /unix/tkAppInit.c
parent0a8a3449f94769a8d0934f7cfefa9145a4a74df1 (diff)
downloadtk-47db144ca5053ea42c75249d1269230a1f3eb8fa.zip
tk-47db144ca5053ea42c75249d1269230a1f3eb8fa.tar.gz
tk-47db144ca5053ea42c75249d1269230a1f3eb8fa.tar.bz2
* generic/tkMain.c :
* unix/tkAppInit.c: * win/winMain.c: Added added hooks into the main() code for supporting TclPro and other "big" shells more easily without requiring a copy of the main() code.
Diffstat (limited to 'unix/tkAppInit.c')
-rw-r--r--unix/tkAppInit.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c
index cf283fb..4290f2b 100644
--- a/unix/tkAppInit.c
+++ b/unix/tkAppInit.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: tkAppInit.c,v 1.4 1999/04/16 01:51:45 stanton Exp $
+ * RCS: @(#) $Id: tkAppInit.c,v 1.5 1999/12/02 02:05:39 redman Exp $
*/
#include "tk.h"
@@ -51,7 +51,30 @@ main(argc, argv)
int argc; /* Number of command-line arguments. */
char **argv; /* Values of command-line arguments. */
{
- Tk_Main(argc, argv, Tcl_AppInit);
+ /*
+ * The following #if block allows you to change the AppInit
+ * function by using a #define of TCL_LOCAL_APPINIT instead
+ * of rewriting this entire file. The #if checks for that
+ * #define and uses Tcl_AppInit if it doesn't exist.
+ */
+
+#ifndef TK_LOCAL_APPINIT
+#define TK_LOCAL_APPINIT Tcl_AppInit
+#endif
+ extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
+
+ /*
+ * The following #if block allows you to change how Tcl finds the startup
+ * script, prime the library or encoding paths, fiddle with the argv,
+ * etc., without needing to rewrite Tk_Main()
+ */
+
+#ifdef TK_LOCAL_MAIN_HOOK
+ extern int TK_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
+ TK_LOCAL_MAIN_HOOK(&argc, &argv);
+#endif
+
+ Tk_Main(argc, argv, TK_LOCAL_APPINIT);
return 0; /* Needed only to prevent compiler warning. */
}