00001 /* 00002 * 00003 * Provides a default version of the Tcl_AppInit procedure for 00004 * use in wish and similar Tk-based applications. 00005 * 00006 * Copyright (c) 1993 The Regents of the University of California. 00007 * All rights reserved. 00008 * 00009 * Permission is hereby granted, without written agreement and without 00010 * license or royalty fees, to use, copy, modify, and distribute this 00011 * software and its documentation for any purpose, provided that the 00012 * above copyright notice and the following two paragraphs appear in 00013 * all copies of this software. 00014 * 00015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 00016 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 00017 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 00018 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00019 * 00020 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 00021 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00022 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 00023 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO 00024 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 00025 */ 00026 00027 #include <stdio.h> 00028 #include "config.h" 00029 00030 extern init_misc(); 00031 00032 extern "C" { 00033 int 00034 Tcl_AppInit(Tcl_Interp *interp) 00035 { 00036 if (Tcl_Init(interp) == TCL_ERROR || 00037 Otcl_Init(interp) == TCL_ERROR) 00038 return TCL_ERROR; 00039 00040 Tcl_SetVar(interp, "tcl_rcFileName", "~/.ns.tcl", TCL_GLOBAL_ONLY); 00041 Tcl::init(interp, "ns"); 00042 extern EmbeddedTcl et_ns_lib; 00043 et_ns_lib.load(); 00044 init_misc(); 00045 00046 return (TCL_OK); 00047 } 00048 00049 int 00050 main(int argc, char** argv) 00051 { 00052 Tcl_Main(argc, argv, Tcl_AppInit); 00053 return 0; /* Needed only to prevent compiler warning. */ 00054 } 00055 }
1.4.6