]>
cvs.zerfleddert.de Git - micropolis/blob - src/tclx/src/main.c
4 * Main to run the Tcl shell. This file is a useful template for custom
5 * applications that wish to have Tcl as the top level command language.
6 *-----------------------------------------------------------------------------
7 * Copyright 1992 Karl Lehenbauer and Mark Diekhans.
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation for any purpose and without fee is hereby granted, provided
11 * that the above copyright notice appear in all copies. Karl Lehenbauer and
12 * Mark Diekhans make no representations about the suitability of this
13 * software for any purpose. It is provided "as is" without express or
15 *-----------------------------------------------------------------------------
16 * $Id: main.c,v 2.1 1992/11/10 03:54:12 markd Exp $
17 *-----------------------------------------------------------------------------
32 * If history is to be used, then set the eval procedure pointer that
33 * Tcl_CommandLoop so that history will be recorded. This reference
34 * also brings in history from libtcl.a.
37 tclShellCmdEvalProc
= Tcl_RecordAndEval
;
41 * Create a Tcl interpreter for the session, with all extended commands
42 * initialized. This can be replaced with Tcl_CreateInterp followed
43 * by a subset of the extended command initializaton procedures if
46 interp
= Tcl_CreateExtendedInterp();
49 * >>>>>> INITIALIZE APPLICATION SPECIFIC COMMANDS HERE <<<<<<
53 * Load the tcl startup code, this should pull in all of the tcl
54 * procs, paths, command line processing, autoloads, packages, etc.
55 * If Tcl was invoked interactively, Tcl_Startup will give it
59 Tcl_Startup (interp
, argc
, argv
, NULL
, 0);
62 * Delete the interpreter (not neccessary under Unix, but we do
63 * it if TCL_MEM_DEBUG is set to better enable us to catch memory
64 * corruption problems)
68 Tcl_DeleteInterp(interp
);
71 #ifdef TCL_SHELL_MEM_LEAK
72 printf (" >>> Dumping active memory list to mem.lst <<<\n");
73 if (Tcl_DumpActiveMemory ("mem.lst") != TCL_OK
)
74 panic ("error accessing `mem.lst': %s", strerror (errno
));