7d5fcf4486 2020-04-13 1: #include <tcl.h>
7d5fcf4486 2020-04-13 2:
7d5fcf4486 2020-04-13 3: /*
7d5fcf4486 2020-04-13 4: * tclAppInit.c --
7d5fcf4486 2020-04-13 5: *
7d5fcf4486 2020-04-13 6: * Provides a default version of the main program and Tcl_AppInit
7d5fcf4486 2020-04-13 7: * function for Tcl applications (without Tk).
7d5fcf4486 2020-04-13 8: *
7d5fcf4486 2020-04-13 9: * Copyright (c) 1993 The Regents of the University of California.
7d5fcf4486 2020-04-13 10: * Copyright (c) 1994-1997 Sun Microsystems, Inc.
7d5fcf4486 2020-04-13 11: * Copyright (c) 1998-1999 by Scriptics Corporation.
7d5fcf4486 2020-04-13 12: *
7d5fcf4486 2020-04-13 13: * See the file "license.terms" for information on usage and redistribution of
7d5fcf4486 2020-04-13 14: * this file, and for a DISCLAIMER OF ALL WARRANTIES.
7d5fcf4486 2020-04-13 15: */
7d5fcf4486 2020-04-13 16:
7d5fcf4486 2020-04-13 17: /*
7d5fcf4486 2020-04-13 18: *----------------------------------------------------------------------
7d5fcf4486 2020-04-13 19: *
7d5fcf4486 2020-04-13 20: * Tcl_AppInit --
7d5fcf4486 2020-04-13 21: *
7d5fcf4486 2020-04-13 22: * This function performs application-specific initialization. Most
7d5fcf4486 2020-04-13 23: * applications, especially those that incorporate additional packages,
7d5fcf4486 2020-04-13 24: * will have their own version of this function.
7d5fcf4486 2020-04-13 25: *
7d5fcf4486 2020-04-13 26: * Results:
7d5fcf4486 2020-04-13 27: * Returns a standard Tcl completion code, and leaves an error message in
7d5fcf4486 2020-04-13 28: * the interp's result if an error occurs.
7d5fcf4486 2020-04-13 29: *
7d5fcf4486 2020-04-13 30: * Side effects:
7d5fcf4486 2020-04-13 31: * Depends on the startup script.
7d5fcf4486 2020-04-13 32: *
7d5fcf4486 2020-04-13 33: *----------------------------------------------------------------------
7d5fcf4486 2020-04-13 34: */
7d5fcf4486 2020-04-13 35:
7d5fcf4486 2020-04-13 36: int Tcl_AppInit(Tcl_Interp *interp) {
7d5fcf4486 2020-04-13 37: if (Tcl_Init(interp) == TCL_ERROR) {
7d5fcf4486 2020-04-13 38: return TCL_ERROR;
7d5fcf4486 2020-04-13 39: }
7d5fcf4486 2020-04-13 40:
7d5fcf4486 2020-04-13 41: #ifdef DJGPP
7d5fcf4486 2020-04-13 42: Tcl_SetVar(interp, "tcl_rcFileName", "~/tclsh.rc", TCL_GLOBAL_ONLY);
7d5fcf4486 2020-04-13 43: #else
7d5fcf4486 2020-04-13 44: Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
7d5fcf4486 2020-04-13 45: #endif
7d5fcf4486 2020-04-13 46:
7d5fcf4486 2020-04-13 47: return TCL_OK;
7d5fcf4486 2020-04-13 48: }
7d5fcf4486 2020-04-13 49:
7d5fcf4486 2020-04-13 50: int main(int argc, char **argv) {
7d5fcf4486 2020-04-13 51: Tcl_Main(argc, argv, Tcl_AppInit);
7d5fcf4486 2020-04-13 52: return(1);
7d5fcf4486 2020-04-13 53: }