3 * a skeletal Tcl_AppInit that provides pgtcl initialization
4 * to create a tclsh that can talk to pglite backends
6 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1993 The Regents of the University of California.
8 * Copyright (c) 1994 Sun Microsystems, Inc.
10 * See the file "license.terms" for information on usage and redistribution
11 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
19 * The following variable is a special hack that is needed in order for
20 * Sun shared libraries to be used for Tcl.
25 int *tclDummyMathPtr = (int *) matherr;
30 *----------------------------------------------------------------------
34 * This is the main program for the application.
37 * None: Tcl_Main never returns here, so this procedure never
41 * Whatever the application does.
43 *----------------------------------------------------------------------
47 main(int argc, char **argv)
49 Tcl_Main(argc, argv, Tcl_AppInit);
50 return 0; /* Needed only to prevent compiler
56 *----------------------------------------------------------------------
60 * This procedure performs application-specific initialization.
61 * Most applications, especially those that incorporate additional
62 * packages, will have their own version of this procedure.
65 * Returns a standard Tcl completion code, and leaves an error
66 * message in interp->result if an error occurs.
69 * Depends on the startup script.
71 *----------------------------------------------------------------------
75 Tcl_AppInit(Tcl_Interp *interp)
77 if (Tcl_Init(interp) == TCL_ERROR)
81 * Call the init procedures for included packages. Each call should
84 * if (Mod_Init(interp) == TCL_ERROR) { return TCL_ERROR; }
86 * where "Mod" is the name of the module.
89 if (Pgtcl_Init(interp) == TCL_ERROR)
93 * Call Tcl_CreateCommand for application-specific commands, if they
94 * weren't already created by the init procedures called above.
98 * Specify a user-specific startup file to invoke if the application
99 * is run interactively. Typically the startup file is "~/.apprc"
100 * where "app" is the name of the application. If this line is
101 * deleted then no user-specific startup file will be run under any
105 #if (TCL_MAJOR_VERSION <= 7) && (TCL_MINOR_VERSION < 5)
106 tcl_RcFileName = "~/.tclshrc";
108 Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);