summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls3
-rw-r--r--generic/tclDecls.h1
-rw-r--r--generic/tclOO.h9
-rw-r--r--generic/tclOOStubLib.c71
-rw-r--r--generic/tclStubInit.c10
-rw-r--r--generic/tclStubLib.c13
6 files changed, 27 insertions, 80 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 734aae7..005b513 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -18,9 +18,10 @@ library tcl
# tclPlat - platform specific public
# tclInt - generic private
# tclPlatInt - platform specific private
+# tclOO - tclOO public
interface tcl
-hooks {tclPlat tclInt tclIntPlat}
+hooks {tclPlat tclInt tclIntPlat tclOO}
scspec TCLAPI
# Declare each of the functions in the public Tcl interface. Note that
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index e38f752..673726b 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1731,6 +1731,7 @@ typedef struct {
const struct TclPlatStubs *tclPlatStubs;
const struct TclIntStubs *tclIntStubs;
const struct TclIntPlatStubs *tclIntPlatStubs;
+ const struct TclOOStubs *tclOOStubs;
} TclStubHooks;
typedef struct TclStubs {
diff --git a/generic/tclOO.h b/generic/tclOO.h
index a6e8a22..b8aa974 100644
--- a/generic/tclOO.h
+++ b/generic/tclOO.h
@@ -37,13 +37,8 @@
extern "C" {
#endif
-extern const char *TclOOInitializeStubs(
- Tcl_Interp *, const char *version);
-#define Tcl_OOInitStubs(interp) \
- TclOOInitializeStubs((interp), TCLOO_VERSION)
-#ifndef USE_TCL_STUBS
-# define TclOOInitializeStubs(interp, version) (TCLOO_PATCHLEVEL)
-#endif
+#define Tcl_OOInitStubs(interp) (TCLOO_PATCHLEVEL)
+#define TclOOInitializeStubs(interp, version) (TCLOO_PATCHLEVEL)
/*
* These are opaque types.
diff --git a/generic/tclOOStubLib.c b/generic/tclOOStubLib.c
deleted file mode 100644
index a9fa212..0000000
--- a/generic/tclOOStubLib.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * ORIGINAL SOURCE: tk/generic/tkStubLib.c, version 1.9 2004/03/17
- */
-
-#include "tclOOInt.h"
-
-MODULE_SCOPE const TclOOStubs *tclOOStubsPtr;
-MODULE_SCOPE const TclOOIntStubs *tclOOIntStubsPtr;
-
-const TclOOStubs *tclOOStubsPtr = NULL;
-const TclOOIntStubs *tclOOIntStubsPtr = NULL;
-
-/*
- *----------------------------------------------------------------------
- *
- * TclOOInitializeStubs --
- * Load the tclOO package, initialize stub table pointer. Do not call
- * this function directly, use Tcl_OOInitStubs() macro instead.
- *
- * Results:
- * The actual version of the package that satisfies the request, or NULL
- * to indicate that an error occurred.
- *
- * Side effects:
- * Sets the stub table pointers.
- *
- *----------------------------------------------------------------------
- */
-
-#undef TclOOInitializeStubs
-
-MODULE_SCOPE const char *
-TclOOInitializeStubs(
- Tcl_Interp *interp,
- const char *version)
-{
- int exact = 0;
- const char *packageName = "TclOO";
- const char *errMsg = NULL;
- TclOOStubs *stubsPtr = NULL;
- const char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp,
- packageName, version, exact, &stubsPtr);
-
- if (actualVersion == NULL) {
- return NULL;
- }
- if (stubsPtr == NULL) {
- errMsg = "missing stub table pointer";
- } else {
- tclOOStubsPtr = stubsPtr;
- if (stubsPtr->hooks) {
- tclOOIntStubsPtr = stubsPtr->hooks->tclOOIntStubs;
- } else {
- tclOOIntStubsPtr = NULL;
- }
- return actualVersion;
- }
- tclStubsPtr->tcl_ResetResult(interp);
- tclStubsPtr->tcl_AppendResult(interp, "Error loading ", packageName,
- " (requested version ", version, ", actual version ",
- actualVersion, "): ", errMsg, NULL);
- return NULL;
-}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 5fb501a..1ec155a 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -10,8 +10,15 @@
*/
#include "tclInt.h"
+#include "tclOOInt.h"
#include "tommath.h"
+/*
+ * The actual definition of the variable holding the TclOO stub table.
+ */
+
+MODULE_SCOPE const TclOOStubs tclOOStubs;
+
#ifdef __GNUC__
#pragma GCC dependency "tcl.decls"
#pragma GCC dependency "tclInt.decls"
@@ -694,7 +701,8 @@ const TclTomMathStubs tclTomMathStubs = {
static const TclStubHooks tclStubHooks = {
&tclPlatStubs,
&tclIntStubs,
- &tclIntPlatStubs
+ &tclIntPlatStubs,
+ &tclOOStubs
};
const TclStubs tclStubs = {
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 3e4a5ae..6487ebb 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -12,16 +12,21 @@
*/
#include "tclInt.h"
+#include "tclOOInt.h"
MODULE_SCOPE const TclStubs *tclStubsPtr;
MODULE_SCOPE const TclPlatStubs *tclPlatStubsPtr;
MODULE_SCOPE const TclIntStubs *tclIntStubsPtr;
MODULE_SCOPE const TclIntPlatStubs *tclIntPlatStubsPtr;
+MODULE_SCOPE const TclOOStubs *tclOOStubsPtr;
+MODULE_SCOPE const TclOOIntStubs *tclOOIntStubsPtr;
const TclStubs *tclStubsPtr = NULL;
const TclPlatStubs *tclPlatStubsPtr = NULL;
const TclIntStubs *tclIntStubsPtr = NULL;
const TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
+const TclOOStubs *tclOOStubsPtr = NULL;
+const TclOOIntStubs *tclOOIntStubsPtr = NULL;
/*
* Use our own ISDIGIT to avoid linking to libc on windows
@@ -113,10 +118,18 @@ Tcl_InitStubs(
tclPlatStubsPtr = stubsPtr->hooks->tclPlatStubs;
tclIntStubsPtr = stubsPtr->hooks->tclIntStubs;
tclIntPlatStubsPtr = stubsPtr->hooks->tclIntPlatStubs;
+ tclOOStubsPtr = stubsPtr->hooks->tclOOStubs;
+ if (tclOOStubsPtr && tclOOStubsPtr->hooks) {
+ tclOOIntStubsPtr = tclOOStubsPtr->hooks->tclOOIntStubs;
+ } else {
+ tclOOIntStubsPtr = NULL;
+ }
} else {
tclPlatStubsPtr = NULL;
tclIntStubsPtr = NULL;
tclIntPlatStubsPtr = NULL;
+ tclOOStubsPtr = NULL;
+ tclOOIntStubsPtr = NULL;
}
return actualVersion;