summaryrefslogtreecommitdiffstats
path: root/generic/tkStubLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkStubLib.c')
-rw-r--r--generic/tkStubLib.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c
index 5cea659..8b669db 100644
--- a/generic/tkStubLib.c
+++ b/generic/tkStubLib.c
@@ -4,8 +4,8 @@
* Stub object that will be statically linked into extensions that want
* to access Tk.
*
- * Copyright (c) 1998-1999 Scriptics Corporation.
- * Copyright (c) 1998 Paul Duffin.
+ * Copyright © 1998-1999 Scriptics Corporation.
+ * Copyright © 1998 Paul Duffin.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -75,15 +75,19 @@ Tk_InitStubs(
const char *version,
int exact)
{
- const char *packageName = "Tk";
+ const char *packageName = "tk";
const char *errMsg = NULL;
- ClientData clientData = NULL;
+ void *clientData = NULL;
const char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp,
packageName, version, 0, &clientData);
- const TkStubs *stubsPtr = (const TkStubs *)clientData;
if (actualVersion == NULL) {
- return NULL;
+ packageName = "Tk";
+ actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp,
+ packageName, version, 0, &clientData);
+ if (actualVersion == NULL) {
+ return NULL;
+ }
}
if (exact) {
@@ -113,15 +117,15 @@ Tk_InitStubs(
}
}
}
- if (stubsPtr == NULL) {
+ if (clientData == NULL) {
errMsg = "missing stub table pointer";
} else {
- tkStubsPtr = stubsPtr;
- if (stubsPtr->hooks) {
- tkPlatStubsPtr = stubsPtr->hooks->tkPlatStubs;
- tkIntStubsPtr = stubsPtr->hooks->tkIntStubs;
- tkIntPlatStubsPtr = stubsPtr->hooks->tkIntPlatStubs;
- tkIntXlibStubsPtr = stubsPtr->hooks->tkIntXlibStubs;
+ tkStubsPtr = (const TkStubs *)clientData;
+ if (tkStubsPtr->hooks) {
+ tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
+ tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
+ tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
+ tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
} else {
tkPlatStubsPtr = NULL;
tkIntStubsPtr = NULL;