home *** CD-ROM | disk | FTP | other *** search
- /* CVS $Id: main.c,v 1.2 1994/04/28 16:35:29 shonagh Exp $ */
- /*-------------------------------------------------------------------------
- Copyright (c) 1992 The Santa Cruz Operation, Inc.
- -------------------------------------------------------------------------
- All rights reserved. No part of this program or publication may be
- reproduced, transmitted, transcribed, stored in a retrieval system,
- or translated into any language or computer language, in any form or
- by any means, electronic, mechanical, magnetic, optical, chemical,
- biological, or otherwise, without the prior written permission of:
-
- The Santa Cruz Operation, Inc. (408) 425-7222
- 400 Encinal St, Santa Cruz, CA 95060 USA
- -------------------------------------------------------------------------
-
- SCCS : @(#) main.c 10.1 93/10/04
- Author: wing
- Date : 04-Oct-93
- File : main.c
-
- Modification History:
- M002, 03-Jan-94, wing
- Removed old main.c and replaced with 7.2 dist fake main.
- M001, 11-Oct-93, wing
- removed commands and moved to commands.c
- M000, 04-Oct-93, wing
- created
- -----------------------------------------------------------------------*/
- /*
- * tclXAppInit.c --
- *
- * Provides a default version of the Tcl_AppInit procedure for use with
- * applications built with Extended Tcl. This is based on the the UCB
- * Tcl file tclAppInit.c
- *
- *-----------------------------------------------------------------------------
- * 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: main.c,v 1.2 1994/04/28 16:35:29 shonagh Exp $
- *-----------------------------------------------------------------------------
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
- #include "tclExtend.h"
-
-
- /*
- * The following variable is a special hack that allows applications
- * to be linked using the procedure "main" from the Tcl library. The
- * variable generates a reference to "main", which causes main to
- * be brought in from the library (and all of Tcl with it).
- */
-
- extern int main();
- int *tclXDummyMainPtr = (int *) main;
-
- /*
- *----------------------------------------------------------------------
- *
- * Tcl_AppInit --
- *
- * This procedure performs application-specific initialization.
- * Most applications, especially those that incorporate additional
- * packages, will have their own version of this procedure.
- *
- * Results:
- * Returns a standard Tcl completion code, and leaves an error
- * message in interp->result if an error occurs.
- *
- * Side effects:
- * Depends on the startup script.
- *
- *----------------------------------------------------------------------
- */
-
- int
- Tcl_AppInit(interp)
- Tcl_Interp *interp; /* Interpreter for application. */
- {
- /*
- * Call the init procedures for included packages. Each call should
- * look like this:
- *
- * if (Mod_Init(interp) == TCL_ERROR) {
- * return TCL_ERROR;
- * }
- *
- * where "Mod" is the name of the module.
- */
-
- /*
- * Add in Extended Tcl commands and source TclX initialization file.
- */
- if (TclX_Init (interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
-
- if (Tcl_InitWServer (interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
-
- /*
- * Call Tcl_CreateCommand for application-specific commands, if
- * they weren't already created by the init procedures called above.
- */
-
- return TCL_OK;
- }
-
-
-