1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#include "tcl.h"
#include <stdio.h>
MODULE_SCOPE const TclStubs *tclStubsPtr;
int main(int argc, char **argv) {
const char *version;
int exitcode = 0;
(void)argc;
if (tclStubsPtr != NULL) {
printf("ERROR: stub table is already initialized");
exitcode = 1;
}
tclStubsPtr = NULL;
version = Tcl_SetPanicProc(Tcl_ConsolePanic);
if (tclStubsPtr == NULL) {
printf("ERROR: Tcl_SetPanicProc does not initialize the stub table\n");
exitcode = 1;
}
tclStubsPtr = NULL;
version = Tcl_InitSubsystems();
if (tclStubsPtr == NULL) {
printf("ERROR: Tcl_InitSubsystems does not initialize the stub table\n");
exitcode = 1;
}
tclStubsPtr = NULL;
version = Tcl_FindExecutable(argv[0]);
if (version != NULL) {
printf("Tcl_FindExecutable gives version %s\n", version);
}
if (tclStubsPtr == NULL) {
printf("ERROR: Tcl_FindExecutable does not initialize the stub table\n");
exitcode = 1;
}
if (!exitcode) {
printf("All OK!\n");
}
return exitcode;
}
|