| ︙ | | | ︙ | |
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
int rc
){
struct TclContext *tclContext = (struct TclContext *)ctx;
tcl_NotifyProc *xNotifyProc;
if ( !tclContext ){
Th_ErrorMessage(interp,
"Invalid Tcl context", (const char *)"", 0);
return TH_ERROR;
}
xNotifyProc = bIsPost ? tclContext->xPostEval : tclContext->xPreEval;
if ( xNotifyProc ){
rc = xNotifyProc(bIsPost ?
tclContext->pPostContext : tclContext->pPreContext,
interp, ctx, argc, argv, argl, rc);
|
|
|
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
int rc
){
struct TclContext *tclContext = (struct TclContext *)ctx;
tcl_NotifyProc *xNotifyProc;
if ( !tclContext ){
Th_ErrorMessage(interp,
"invalid Tcl context", (const char *)"", 0);
return TH_ERROR;
}
xNotifyProc = bIsPost ? tclContext->xPostEval : tclContext->xPreEval;
if ( xNotifyProc ){
rc = xNotifyProc(bIsPost ?
tclContext->pPostContext : tclContext->pPreContext,
interp, ctx, argc, argv, argl, rc);
|
| ︙ | | | ︙ | |
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){
Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]);
Tcl_DecrRefCount(objPtr);
Tcl_Release((ClientData)tclInterp);
return TH_ERROR;
}
if( !cmdInfo.objProc ){
Th_ErrorMessage(interp, "Cannot invoke Tcl command:", argv[1], argl[1]);
Tcl_DecrRefCount(objPtr);
Tcl_Release((ClientData)tclInterp);
return TH_ERROR;
}
Tcl_DecrRefCount(objPtr);
#endif
COPY_ARGV_TO_OBJV();
|
|
|
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
if( !command || Tcl_GetCommandInfoFromToken(command,&cmdInfo)==0 ){
Th_ErrorMessage(interp, "Tcl command not found:", argv[1], argl[1]);
Tcl_DecrRefCount(objPtr);
Tcl_Release((ClientData)tclInterp);
return TH_ERROR;
}
if( !cmdInfo.objProc ){
Th_ErrorMessage(interp, "cannot invoke Tcl command:", argv[1], argl[1]);
Tcl_DecrRefCount(objPtr);
Tcl_Release((ClientData)tclInterp);
return TH_ERROR;
}
Tcl_DecrRefCount(objPtr);
#endif
COPY_ARGV_TO_OBJV();
|
| ︙ | | | ︙ | |
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
|
tcl_CreateInterpProc **pxCreateInterp
){
#if defined(USE_TCL_STUBS)
char fileName[] = TCL_LIBRARY_NAME;
#endif
if( !pLibrary || !pxFindExecutable || !pxCreateInterp ){
Th_ErrorMessage(interp,
"Invalid Tcl loader argument(s)", (const char *)"", 0);
return TH_ERROR;
}
#if defined(USE_TCL_STUBS)
do {
void *library = dlopen(fileName, RTLD_NOW | RTLD_GLOBAL);
if( library ){
tcl_FindExecutableProc *xFindExecutable;
tcl_CreateInterpProc *xCreateInterp;
const char *procName = TCL_FINDEXECUTABLE_NAME;
xFindExecutable = (tcl_FindExecutableProc *)dlsym(library, procName + 1);
if( !xFindExecutable ){
xFindExecutable = (tcl_FindExecutableProc *)dlsym(library, procName);
}
if( !xFindExecutable ){
Th_ErrorMessage(interp,
"Could not locate Tcl_FindExecutable", (const char *)"", 0);
dlclose(library);
return TH_ERROR;
}
procName = TCL_CREATEINTERP_NAME;
xCreateInterp = (tcl_CreateInterpProc *)dlsym(library, procName + 1);
if( !xCreateInterp ){
xCreateInterp = (tcl_CreateInterpProc *)dlsym(library, procName);
}
if( !xCreateInterp ){
Th_ErrorMessage(interp,
"Could not locate Tcl_CreateInterp", (const char *)"", 0);
dlclose(library);
return TH_ERROR;
}
*pLibrary = library;
*pxFindExecutable = xFindExecutable;
*pxCreateInterp = xCreateInterp;
return TH_OK;
}
} while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
Th_ErrorMessage(interp,
"Could not load Tcl shared library \"" TCL_LIBRARY_NAME "\"",
(const char *)"", 0);
return TH_ERROR;
#else
*pLibrary = 0;
*pxFindExecutable = Tcl_FindExecutable;
*pxCreateInterp = Tcl_CreateInterp;
return TH_OK;
|
|
|
|
|
|
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
|
tcl_CreateInterpProc **pxCreateInterp
){
#if defined(USE_TCL_STUBS)
char fileName[] = TCL_LIBRARY_NAME;
#endif
if( !pLibrary || !pxFindExecutable || !pxCreateInterp ){
Th_ErrorMessage(interp,
"invalid Tcl loader argument(s)", (const char *)"", 0);
return TH_ERROR;
}
#if defined(USE_TCL_STUBS)
do {
void *library = dlopen(fileName, RTLD_NOW | RTLD_GLOBAL);
if( library ){
tcl_FindExecutableProc *xFindExecutable;
tcl_CreateInterpProc *xCreateInterp;
const char *procName = TCL_FINDEXECUTABLE_NAME;
xFindExecutable = (tcl_FindExecutableProc *)dlsym(library, procName + 1);
if( !xFindExecutable ){
xFindExecutable = (tcl_FindExecutableProc *)dlsym(library, procName);
}
if( !xFindExecutable ){
Th_ErrorMessage(interp,
"could not locate Tcl_FindExecutable", (const char *)"", 0);
dlclose(library);
return TH_ERROR;
}
procName = TCL_CREATEINTERP_NAME;
xCreateInterp = (tcl_CreateInterpProc *)dlsym(library, procName + 1);
if( !xCreateInterp ){
xCreateInterp = (tcl_CreateInterpProc *)dlsym(library, procName);
}
if( !xCreateInterp ){
Th_ErrorMessage(interp,
"could not locate Tcl_CreateInterp", (const char *)"", 0);
dlclose(library);
return TH_ERROR;
}
*pLibrary = library;
*pxFindExecutable = xFindExecutable;
*pxCreateInterp = xCreateInterp;
return TH_OK;
}
} while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
Th_ErrorMessage(interp,
"could not load Tcl shared library \"" TCL_LIBRARY_NAME "\"",
(const char *)"", 0);
return TH_ERROR;
#else
*pLibrary = 0;
*pxFindExecutable = Tcl_FindExecutable;
*pxCreateInterp = Tcl_CreateInterp;
return TH_OK;
|
| ︙ | | | ︙ | |
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
|
char **argv;
char *argv0 = 0;
Tcl_Interp *tclInterp;
char *setup;
if ( !tclContext ){
Th_ErrorMessage(interp,
"Invalid Tcl context", (const char *)"", 0);
return TH_ERROR;
}
if ( tclContext->interp ){
return TH_OK;
}
if( loadTcl(interp, &tclContext->library, &tclContext->xFindExecutable,
&tclContext->xCreateInterp)!=TH_OK ){
|
|
|
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
|
char **argv;
char *argv0 = 0;
Tcl_Interp *tclInterp;
char *setup;
if ( !tclContext ){
Th_ErrorMessage(interp,
"invalid Tcl context", (const char *)"", 0);
return TH_ERROR;
}
if ( tclContext->interp ){
return TH_OK;
}
if( loadTcl(interp, &tclContext->library, &tclContext->xFindExecutable,
&tclContext->xCreateInterp)!=TH_OK ){
|
| ︙ | | | ︙ | |
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
|
tclInterp = tclContext->xCreateInterp();
if( !tclInterp ||
#if defined(USE_TCL_STUBS)
!Tcl_InitStubs(tclInterp, "8.4", 0) ||
#endif
Tcl_InterpDeleted(tclInterp) ){
Th_ErrorMessage(interp,
"Could not create Tcl interpreter", (const char *)"", 0);
return TH_ERROR;
}
tclContext->interp = tclInterp;
if( Tcl_Init(tclInterp)!=TCL_OK ){
Th_ErrorMessage(interp,
"Tcl initialization error:", Tcl_GetStringResult(tclInterp), -1);
Tcl_DeleteInterp(tclInterp);
|
|
|
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
|
tclInterp = tclContext->xCreateInterp();
if( !tclInterp ||
#if defined(USE_TCL_STUBS)
!Tcl_InitStubs(tclInterp, "8.4", 0) ||
#endif
Tcl_InterpDeleted(tclInterp) ){
Th_ErrorMessage(interp,
"could not create Tcl interpreter", (const char *)"", 0);
return TH_ERROR;
}
tclContext->interp = tclInterp;
if( Tcl_Init(tclInterp)!=TCL_OK ){
Th_ErrorMessage(interp,
"Tcl initialization error:", Tcl_GetStringResult(tclInterp), -1);
Tcl_DeleteInterp(tclInterp);
|
| ︙ | | | ︙ | |