| 332 | |
| 333 | |
| 334 | int |
| 335 | TclInterpreter::run() { |
| 336 | /* |
| 337 | * If a script file was specified then just source that file |
| 338 | * and quit. |
| 339 | */ |
| 340 | |
| 341 | |
| 342 | if (tclStartupScriptFileName != NULL) { |
| 343 | |
| 344 | code = Tcl_EvalFile(interp, tclStartupScriptFileName); |
| 345 | |
| 346 | if (code != TCL_OK) { |
| 347 | errChannel = Tcl_GetStdChannel(TCL_STDERR); |
| 348 | if (errChannel) { |
| 349 | /* |
| 350 | * The following statement guarantees that the errorInfo |
| 351 | * variable is set properly. |
| 352 | */ |
| 353 | |
| 354 | Tcl_AddErrorInfo(interp, ""); |
| 355 | Tcl_WriteObj(errChannel, Tcl_GetVar2Ex(interp, "errorInfo", |
| 356 | NULL, TCL_GLOBAL_ONLY)); |
| 357 | Tcl_WriteChars(errChannel, "\n", 1); |
| 358 | } |
| 359 | exitCode = 1; |
| 360 | } |
| 361 | return 0; |
| 362 | } |
| 363 | |
| 364 | |
| 365 | else { |
| 366 | /* |
| 367 | const char *pwd = getInterpPWD(interp); |
| 368 | simulationInfo.start(); |
| 369 | simulationInfo.addInputFile(tclStartupScriptFileName, pwd); |
| 370 | */ |
| 371 | |
| 372 | |
| 373 | /* |
| 374 | * We're running interactively. Source a user-specific startup |
| 375 | * file if the application specified one and if the file exists. |
| 376 | */ |
| 377 | |
| 378 | Tcl_DStringFree(&argString); |
| 379 | |
| 380 | Tcl_SourceRCFile(interp); |
| 381 | |
| 382 | /* |
| 383 | * Process commands from stdin until there's an end-of-file. Note |
| 384 | * that we need to fetch the standard channels again after every |
| 385 | * eval, since they may have been changed. |
| 386 | */ |
| 387 | |
| 388 | /* |
| 389 | if (simulationInfoOutputFilename != 0) { |
| 390 | simulationInfo.start(); |
| 391 | } |
nothing calls this directly
no test coverage detected