4 * a skeletal Tcl_AppInit that provides pgtcl initialization
5 * to create a tclsh that can talk to pglite backends
7 * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1993 The Regents of the University of California.
9 * Copyright (c) 1994 Sun Microsystems, Inc.
11 * See the file "license.terms" for information on usage and redistribution
12 * 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: Tk_Main never returns here, so this procedure never
41 * Whatever the application does.
43 *----------------------------------------------------------------------
47 main(int argc, char **argv)
49 Tk_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)
79 if (Tk_Init(interp) == TCL_ERROR)
83 * Call the init procedures for included packages. Each call should
86 * if (Mod_Init(interp) == TCL_ERROR) { return TCL_ERROR; }
88 * where "Mod" is the name of the module.
91 if (Pgtcl_Init(interp) == TCL_ERROR)
95 * Call Tcl_CreateCommand for application-specific commands, if they
96 * weren't already created by the init procedures called above.
100 * Specify a user-specific startup file to invoke if the application
101 * is run interactively. Typically the startup file is "~/.apprc"
102 * where "app" is the name of the application. If this line is
103 * deleted then no user-specific startup file will be run under any
107 #if (TCL_MAJOR_VERSION <= 7) && (TCL_MINOR_VERSION < 5)
108 tcl_RcFileName = "~/.wishrc";
110 Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);