MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / Tk_MainOpenSees

Function Tk_MainOpenSees

SRC/tcl/tkMain.cpp:177–377  ·  view source on GitHub ↗

*---------------------------------------------------------------------- * * Tk_MainOpenSees -- * * Main program for Wish and most other Tk-based applications. * * Results: * None. This procedure never returns (it exits the process when * it's done. * * Side effects: * This procedure initializes the Tk world and then starts * interpreting commands; almost anything could happen, dependi

Source from the content-addressed store, hash-verified

175 *----------------------------------------------------------------------
176 */
177void
178Tk_MainOpenSees(int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp)
179{
180 char *args, *fileName;
181 char buf[TCL_INTEGER_SPACE];
182 int code;
183 size_t length;
184 Tcl_Channel inChannel, outChannel;
185 Tcl_DString argString;
186 ThreadSpecificData *tsdPtr;
187
188#ifdef __WIN32__
189 HANDLE handle;
190#endif
191
192 /* fmk - beginning of modifications for OpenSees */
193 fprintf(stderr,"\n\n");
194 fprintf(stderr," OpenSees -- Open System For Earthquake Engineering Simulation\n");
195 fprintf(stderr," Pacific Earthquake Engineering Research Center\n");
196 fprintf(stderr," Version %s %s\n\n", OPS_VERSION, WIN_ARCH);
197
198 fprintf(stderr," (c) Copyright 1999-2016 The Regents of the University of California\n");
199 fprintf(stderr," All Rights Reserved\n");
200 fprintf(stderr," (Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)\n\n\n");
201 /* fmk - end of modifications for OpenSees */
202
203 /*
204 * Ensure that we are getting the matching version of Tcl. This is
205 * really only an issue when Tk is loaded dynamically.
206 */
207
208 if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
209 abort();
210 }
211
212 tsdPtr = (ThreadSpecificData *)
213 Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
214
215 Tcl_FindExecutable(argv[0]);
216 tsdPtr->interp = interp;
217
218#if (defined(__WIN32__) || defined(MAC_TCL))
219 Tk_InitConsoleChannels(interp);
220#endif
221
222#ifdef TCL_MEM_DEBUG
223 Tcl_InitMemory(interp);
224#endif
225
226 /*
227 * Parse command-line arguments. A leading "-file" argument is
228 * ignored (a historical relic from the distant past). If the
229 * next argument doesn't start with a "-" then strip it off and
230 * use it as the name of a script file to process.
231 */
232
233 fileName = TclGetStartupScriptFileName();
234

Callers 3

WinMainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 4

OpenSeesParseArgvFunction · 0.85
Tcl_SourceRCFileFunction · 0.85
PromptFunction · 0.70

Tested by

no test coverage detected