00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 extern "C" {
00043 #include <tcl.h>
00044
00045 }
00046
00047 #include "commands.h"
00048
00049
00050
00051
00052
00053
00054 #ifdef _UNIX
00055
00056
00057 #endif
00058
00059
00060 #ifdef TCL_TEST
00061
00062 extern "C" {
00063 #include "tclInt.h"
00064 }
00065
00066 extern int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp));
00067 extern int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
00068 extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
00069 extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
00070 #ifdef TCL_THREADS
00071 extern int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp));
00072 #endif
00073
00074 #endif
00075
00076 #ifdef TCL_XT_TEST
00077 extern void XtToolkitInitialize _ANSI_ARGS_((void));
00078 extern int Tclxttest_Init _ANSI_ARGS_((Tcl_Interp *interp));
00079 #endif
00080
00081
00082
00083 #include <FileStream.h>
00084 #include <SimulationInformation.h>
00085 extern SimulationInformation simulationInfo;
00086 extern char *simulationInfoOutputFilename;
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 extern void g3TclMain(int argc, char **argv, Tcl_AppInitProc *appInitProc, int rank, int np);
00109
00110 int
00111 main(int argc, char **argv)
00112 {
00113
00114
00115
00116
00117
00118
00119
00120 #ifndef TCL_LOCAL_APPINIT
00121 #define TCL_LOCAL_APPINIT Tcl_AppInit
00122 #endif
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 #ifdef TCL_LOCAL_MAIN_HOOK
00135 extern int TCL_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
00136 #endif
00137
00138 #ifdef TCL_XT_TEST
00139 XtToolkitInitialize();
00140 #endif
00141
00142 #ifdef TCL_LOCAL_MAIN_HOOK
00143 TCL_LOCAL_MAIN_HOOK(&argc, &argv);
00144 #endif
00145
00146 g3TclMain(argc, argv, TCL_LOCAL_APPINIT, 0, 1);
00147
00148 return 0;
00149 }
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 int Tcl_AppInit(Tcl_Interp *interp)
00173 {
00174 if (Tcl_Init(interp) == TCL_ERROR) {
00175 return TCL_ERROR;
00176 }
00177
00178 #ifdef TCL_TEST
00179 #ifdef TCL_XT_TEST
00180 if (Tclxttest_Init(interp) == TCL_ERROR) {
00181 return TCL_ERROR;
00182 }
00183 #endif
00184 if (Tcltest_Init(interp) == TCL_ERROR) {
00185 return TCL_ERROR;
00186 }
00187 Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
00188 (Tcl_PackageInitProc *) NULL);
00189 if (TclObjTest_Init(interp) == TCL_ERROR) {
00190 return TCL_ERROR;
00191 }
00192 #ifdef TCL_THREADS
00193 if (TclThread_Init(interp) == TCL_ERROR) {
00194 return TCL_ERROR;
00195 }
00196 #endif
00197 if (Procbodytest_Init(interp) == TCL_ERROR) {
00198 return TCL_ERROR;
00199 }
00200 Tcl_StaticPackage(interp, "procbodytest", Procbodytest_Init,
00201 Procbodytest_SafeInit);
00202 #endif
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 if (g3AppInit(interp) < 0)
00221 return TCL_ERROR;
00222
00223
00224
00225
00226
00227
00228
00229
00230 Tcl_SetVar(interp, "tcl_rcFileName", "~/.tclshrc", TCL_GLOBAL_ONLY);
00231 return TCL_OK;
00232 }
00233
00234
00235
00236 int OpenSeesExit(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
00237 {
00238
00239 if (simulationInfoOutputFilename != 0) {
00240 simulationInfo.end();
00241 FileStream simulationInfoOutputFile;
00242 simulationInfoOutputFile.setFile(simulationInfoOutputFilename);
00243 simulationInfoOutputFile.open();
00244 simulationInfoOutputFile << simulationInfo;
00245 simulationInfoOutputFile.close();
00246 }
00247
00248 Tcl_Exit(0);
00249 return 0;
00250 }
00251