]>
git.zerfleddert.de Git - micropolis/blob - src/tclx/src/mainplus.cc
0374f5c7c2f5f69fe637c7f89dc6b501949bf855
4 * C++ based main. It is an alternative to the existing main.c to set up
5 * the Tcl shell and may be used as a example on how to use tcl++.h
7 *---------------------------------------------------------------------------
8 * Copyright 1992 Karl Lehenbauer and Mark Diekhans.
10 * Permission to use, copy, modify, and distribute this software and its
11 * documentation for any purpose and without fee is hereby granted, provided
12 * that the above copyright notice appear in all copies. Karl Lehenbauer,
13 * Mark Diekhans, and Peter da Silva make no representations about the
14 * suitability of this software for any purpose. It is provided "as is"
15 * without express or implied warranty.
16 *---------------------------------------------------------------------------
17 * Based on Tcl C++ classes developed by Parag Patel.
18 *-----------------------------------------------------------------------------
19 * $Id: main++.C,v 2.0 1992/10/16 04:51:31 markd Rel $
20 *-----------------------------------------------------------------------------
26 * This file is optional.
28 #include "patchlevel.h"
34 TclInterp_cl
*interpPtr
;
37 * If history is to be used, then set the eval procedure pointer that
38 * Tcl_CommandLoop so that history will be recorded. This reference
39 * also brings in history from Tcl.a.
42 tclShellCmdEvalProc
= (int (*)())Tcl_RecordAndEval
;
46 * Create a Tcl interpreter for the session, with all extended commands
47 * initialized. This can be replaced with Tcl_CreateInterp followed
48 * by a subset of the extended command initializaton procedures if
51 interpPtr
= new TclInterp_cl
;
54 * >>>>>> INITIALIZE APPLICATION SPECIFIC COMMANDS HERE <<<<<<
58 * Load the tcl startup code, this should pull in all of the tcl
59 * procs, paths, command line processing, autoloads, packages, etc.
60 * If Tcl was invoked interactively, Tcl_Startup will give it
64 interpPtr
->Startup (argc
, argv
, NULL
, 0);
67 * Delete the interpreter (not neccessary under Unix, but we do
68 * it if TCL_MEM_DEBUG is set to better enable us to catch memory
69 * corruption problems)
76 #ifdef TCL_SHELL_MEM_LEAK
77 printf (" >>> Dumping active memory list to mem.lst <<<\n");
78 if (Tcl_DumpActiveMemory ("mem.lst") != TCL_OK
)
79 panic ("error accessing `mem.lst': %s", strerror (errno
));