summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLibCompat.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-19 21:57:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-19 21:57:09 (GMT)
commitb8bb091e43904fa2897b72f1853d1d9f298d26ac (patch)
tree2e1c470dd2a4ee3ac2773f9bd6ee3feb8668be63 /generic/tclStubLibCompat.c
parent9c8731a3a9259e66d93d399531844eebc954544e (diff)
parent7f4b300e2a1f846f1aff77518a22caf720b83725 (diff)
downloadtcl-tcl_nosize.zip
tcl-tcl_nosize.tar.gz
tcl-tcl_nosize.tar.bz2
(Bad idea)tcl_nosize
Diffstat (limited to 'generic/tclStubLibCompat.c')
-rw-r--r--generic/tclStubLibCompat.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/generic/tclStubLibCompat.c b/generic/tclStubLibCompat.c
new file mode 100644
index 0000000..7d8c5c3
--- /dev/null
+++ b/generic/tclStubLibCompat.c
@@ -0,0 +1,57 @@
+/*
+ * tclStubLibCompat.c --
+ *
+ * Stub object that will be statically linked into extensions that want
+ * to access Tcl.
+ *
+ * Copyright (c) 2012 Jan Nijtmans
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+/*
+ * Small wrapper, which allows Tcl8 extensions to use the same stub
+ * library as Tcl 9.
+ */
+
+#include "tclInt.h"
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_InitStubs --
+ *
+ * Tries to initialise the stub table pointers and ensures that the
+ * correct version of Tcl is loaded.
+ *
+ * Results:
+ * The actual version of Tcl that satisfies the request, or NULL to
+ * indicate that an error occurred.
+ *
+ * Side effects:
+ * Sets the stub table pointers.
+ *
+ *----------------------------------------------------------------------
+ */
+#undef Tcl_InitStubs
+
+MODULE_SCOPE const char *
+Tcl_InitStubs(
+ Tcl_Interp *interp,
+ const char *version,
+ int exact)
+{
+ /* Use the hardcoded Tcl8 magic value here. */
+ return TclInitStubs(interp, version, exact, (int) 0xFCA3BACF);
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
+