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