summaryrefslogtreecommitdiffstats
path: root/generic/tclStubInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-21 13:51:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-21 13:51:11 (GMT)
commite0e07babd25d3b621d8ffcc7c2b636aea32876d2 (patch)
treefa2a7cbb78c518d7f3095c935132ae83b6ba3174 /generic/tclStubInit.c
parent0218abe5f52843f501c1735ffeadef3d5e9d24bd (diff)
downloadtcl-e0e07babd25d3b621d8ffcc7c2b636aea32876d2.zip
tcl-e0e07babd25d3b621d8ffcc7c2b636aea32876d2.tar.gz
tcl-e0e07babd25d3b621d8ffcc7c2b636aea32876d2.tar.bz2
Put back Tcl[GS]etStartupScript(Path|FileName) in private stub table, so extensions using this (like Tk 8.4) will continue to work in all Tcl 8.x versions.
Extensions using this still cannot be compiled against Tcl 8.6 headers.
Diffstat (limited to 'generic/tclStubInit.c')
-rw-r--r--generic/tclStubInit.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 1d1fe15..1dbdc09 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -54,6 +54,31 @@ static int TclSockMinimumBuffersOld(int sock, int size)
}
#endif
+#define TclSetStartupScriptPath setStartupScriptPath
+static void TclSetStartupScriptPath(Tcl_Obj *path)
+{
+ Tcl_SetStartupScript(path, NULL);
+}
+#define TclGetStartupScriptPath getStartupScriptPath
+static Tcl_Obj *TclGetStartupScriptPath(void)
+{
+ return Tcl_GetStartupScript(NULL);
+}
+#define TclSetStartupScriptFileName setStartupScriptFileName
+static void TclSetStartupScriptFileName(
+ const char *fileName)
+{
+ Tcl_SetStartupScript(Tcl_NewStringObj(fileName,-1), NULL);
+}
+#define TclGetStartupScriptFileName getStartupScriptFileName
+static const char *TclGetStartupScriptFileName(void)
+{
+ Tcl_Obj *path = Tcl_GetStartupScript(NULL);
+ if (path == NULL) {
+ return NULL;
+ }
+ return Tcl_GetStringFromObj(path, NULL);
+}
#if defined(_WIN32) || defined(__CYGWIN__)
#undef TclWinNToHS
@@ -348,8 +373,8 @@ static const TclIntStubs tclIntStubs = {
0, /* 155 */
TclRegError, /* 156 */
TclVarTraceExists, /* 157 */
- 0, /* 158 */
- 0, /* 159 */
+ TclSetStartupScriptFileName, /* 158 */
+ TclGetStartupScriptFileName, /* 159 */
0, /* 160 */
TclChannelTransform, /* 161 */
TclChannelEventScriptInvoker, /* 162 */
@@ -357,8 +382,8 @@ static const TclIntStubs tclIntStubs = {
TclExpandCodeArray, /* 164 */
TclpSetInitialEncodings, /* 165 */
TclListObjSetElement, /* 166 */
- 0, /* 167 */
- 0, /* 168 */
+ TclSetStartupScriptPath, /* 167 */
+ TclGetStartupScriptPath, /* 168 */
TclpUtfNcmp2, /* 169 */
TclCheckInterpTraces, /* 170 */
TclCheckExecutionTraces, /* 171 */