a178887263 2020-04-13 rkeene: #include <tcl.h>
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: /*
a178887263 2020-04-13 rkeene: * tclAppInit.c --
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * Provides a default version of the main program and Tcl_AppInit
a178887263 2020-04-13 rkeene: * function for Tcl applications (without Tk).
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * Copyright (c) 1993 The Regents of the University of California.
a178887263 2020-04-13 rkeene: * Copyright (c) 1994-1997 Sun Microsystems, Inc.
a178887263 2020-04-13 rkeene: * Copyright (c) 1998-1999 by Scriptics Corporation.
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * See the file "license.terms" for information on usage and redistribution of
a178887263 2020-04-13 rkeene: * this file, and for a DISCLAIMER OF ALL WARRANTIES.
a178887263 2020-04-13 rkeene: */
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: /*
a178887263 2020-04-13 rkeene: *----------------------------------------------------------------------
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * Tcl_AppInit --
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * This function performs application-specific initialization. Most
a178887263 2020-04-13 rkeene: * applications, especially those that incorporate additional packages,
a178887263 2020-04-13 rkeene: * will have their own version of this function.
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * Results:
a178887263 2020-04-13 rkeene: * Returns a standard Tcl completion code, and leaves an error message in
a178887263 2020-04-13 rkeene: * the interp's result if an error occurs.
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: * Side effects:
a178887263 2020-04-13 rkeene: * Depends on the startup script.
a178887263 2020-04-13 rkeene: *
a178887263 2020-04-13 rkeene: *----------------------------------------------------------------------
a178887263 2020-04-13 rkeene: */
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: int Tcl_AppInit(Tcl_Interp *interp) {
a178887263 2020-04-13 rkeene: if (Tcl_Init(interp) == TCL_ERROR) {
a178887263 2020-04-13 rkeene: return TCL_ERROR;
a178887263 2020-04-13 rkeene: }
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: #ifdef DJGPP
a178887263 2020-04-13 rkeene: Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY);
a178887263 2020-04-13 rkeene: #else
a178887263 2020-04-13 rkeene: Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
a178887263 2020-04-13 rkeene: #endif
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: return TCL_OK;
a178887263 2020-04-13 rkeene: }
a178887263 2020-04-13 rkeene:
a178887263 2020-04-13 rkeene: int main(int argc, char **argv) {
a178887263 2020-04-13 rkeene: Tcl_Main(argc, argv, Tcl_AppInit);
a178887263 2020-04-13 rkeene: return(1);
a178887263 2020-04-13 rkeene: }