home *** CD-ROM | disk | FTP | other *** search
- /*
- * tclXmain.c --
- *
- * Main to run the Tcl shell. This file is a useful template for custom
- * applications that wish to have Tcl as the top level command language.
- *-----------------------------------------------------------------------------
- * Copyright 1991-1993 Karl Lehenbauer and Mark Diekhans.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies. Karl Lehenbauer and
- * Mark Diekhans make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *-----------------------------------------------------------------------------
- * $Id: tclXmain.c,v 2.6 1993/08/31 23:03:20 markd Exp $
- *-----------------------------------------------------------------------------
- */
-
- #include "tclExtend.h"
-
- int
- main(argc, argv)
- int argc;
- char **argv;
- {
- Tcl_Interp *interp;
-
- /*
- * Create a Tcl interpreter for the session, with all extended commands
- * initialized. This can be replaced with Tcl_CreateInterp followed
- * by a subset of the extended command initializaton procedures if
- * desired.
- */
- interp = Tcl_CreateExtendedInterp();
-
- /*
- * >>>>>> INITIALIZE APPLICATION SPECIFIC COMMANDS HERE <<<<<<
- */
-
- /*
- * Load the tcl startup code, this should pull in all of the tcl
- * procs, paths, command line processing, autoloads, packages, etc.
- * If Tcl was invoked interactively, Tcl_Startup will give it
- * a command loop.
- */
-
- Tcl_Startup (interp, 0, argc, argv);
-
- /*
- * Delete the interpreter (not neccessary under Unix, but we do
- * it if TCL_MEM_DEBUG is set to better enable us to catch memory
- * corruption problems)
- */
-
- #ifdef TCL_MEM_DEBUG
- Tcl_DeleteInterp(interp);
- #endif
-
- #ifdef TCL_SHELL_MEM_LEAK
- printf (" >>> Dumping active memory list to mem.lst <<<\n");
- if (Tcl_DumpActiveMemory ("mem.lst") != TCL_OK)
- panic ("error accessing `mem.lst': %s", strerror (errno));
- #endif
-
- exit(0);
- }
-
-