summaryrefslogtreecommitdiffstats
path: root/unix/dltest
diff options
context:
space:
mode:
Diffstat (limited to 'unix/dltest')
-rw-r--r--unix/dltest/Makefile.in15
-rw-r--r--unix/dltest/pkga.c22
-rw-r--r--unix/dltest/pkgb.c55
-rw-r--r--unix/dltest/pkgc.c27
-rw-r--r--unix/dltest/pkgd.c27
-rw-r--r--unix/dltest/pkge.c10
-rw-r--r--unix/dltest/pkgooa.c141
-rw-r--r--unix/dltest/pkgua.c40
8 files changed, 87 insertions, 250 deletions
diff --git a/unix/dltest/Makefile.in b/unix/dltest/Makefile.in
index 25b9376..01589d9 100644
--- a/unix/dltest/Makefile.in
+++ b/unix/dltest/Makefile.in
@@ -22,14 +22,14 @@ LDFLAGS_DEBUG = @LDFLAGS_DEBUG@
LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
LDFLAGS = @LDFLAGS_DEFAULT@ @LDFLAGS@
-CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic -DTCL_MEM_DEBUG \
+CC_SWITCHES = $(CFLAGS) -I${SRC_DIR}/../../generic -I${BUILD_DIR}/.. -DTCL_MEM_DEBUG \
${SHLIB_CFLAGS} -DUSE_TCL_STUBS ${AC_FLAGS}
-all: pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} pkgd${SHLIB_SUFFIX} pkge${SHLIB_SUFFIX} pkgua${SHLIB_SUFFIX} pkgooa${SHLIB_SUFFIX}
+all: pkga${SHLIB_SUFFIX} pkgb${SHLIB_SUFFIX} pkgc${SHLIB_SUFFIX} pkgd${SHLIB_SUFFIX} pkge${SHLIB_SUFFIX} pkgua${SHLIB_SUFFIX}
@if test -n "$(DLTEST_SUFFIX)"; then $(MAKE) dltest_suffix; fi
@touch ../dltest.marker
-dltest_suffix: pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} pkgd${DLTEST_SUFFIX} pkge${DLTEST_SUFFIX} pkgua${DLTEST_SUFFIX} pkgooa${DLTEST_SUFFIX}
+dltest_suffix: pkga${DLTEST_SUFFIX} pkgb${DLTEST_SUFFIX} pkgc${DLTEST_SUFFIX} pkgd${DLTEST_SUFFIX} pkge${DLTEST_SUFFIX} pkgua${DLTEST_SUFFIX}
@touch ../dltest.marker
pkga.o: $(SRC_DIR)/pkga.c
@@ -50,9 +50,6 @@ pkge.o: $(SRC_DIR)/pkge.c
pkgua.o: $(SRC_DIR)/pkgua.c
$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgua.c
-pkgooa.o: $(SRC_DIR)/pkgooa.c
- $(CC) -c $(CC_SWITCHES) $(SRC_DIR)/pkgooa.c
-
pkga${SHLIB_SUFFIX}: pkga.o
${SHLIB_LD} -o pkga${SHLIB_SUFFIX} pkga.o ${SHLIB_LD_LIBS}
@@ -71,9 +68,6 @@ pkge${SHLIB_SUFFIX}: pkge.o
pkgua${SHLIB_SUFFIX}: pkgua.o
${SHLIB_LD} -o pkgua${SHLIB_SUFFIX} pkgua.o ${SHLIB_LD_LIBS}
-pkgooa${SHLIB_SUFFIX}: pkgooa.o
- ${SHLIB_LD} -o pkgooa${SHLIB_SUFFIX} pkgooa.o ${SHLIB_LD_LIBS}
-
pkga${DLTEST_SUFFIX}: pkga.o
${DLTEST_LD} -o pkga${DLTEST_SUFFIX} pkga.o ${SHLIB_LD_LIBS}
@@ -92,9 +86,6 @@ pkge${DLTEST_SUFFIX}: pkge.o
pkgua${DLTEST_SUFFIX}: pkgua.o
${DLTEST_LD} -o pkgua${DLTEST_SUFFIX} pkgua.o ${SHLIB_LD_LIBS}
-pkgooa${DLTEST_SUFFIX}: pkgooa.o
- ${DLTEST_LD} -o pkgooa${DLTEST_SUFFIX} pkgooa.o ${SHLIB_LD_LIBS}
-
clean:
rm -f *.o lib.exp ../dltest.marker
@if test "$(SHLIB_SUFFIX)" != ""; then \
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index 5bf3c1e..f001cdf 100644
--- a/unix/dltest/pkga.c
+++ b/unix/dltest/pkga.c
@@ -10,7 +10,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
@@ -18,9 +17,9 @@
*/
static int Pkga_EqObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
static int Pkga_QuoteObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
/*
*----------------------------------------------------------------------
@@ -45,10 +44,10 @@ Pkga_EqObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int result;
- const char *str1, *str2;
+ CONST char *str1, *str2;
int len1, len2;
if (objc != 3) {
@@ -89,7 +88,7 @@ Pkga_QuoteObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
@@ -116,22 +115,23 @@ Pkga_QuoteObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkga_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
code = Tcl_PkgProvide(interp, "Pkga", "1.0");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index f102496..4d8cdab 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
@@ -19,11 +18,9 @@
*/
static int Pkgb_SubObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
static int Pkgb_UnsafeObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
-static int Pkgb_DemoObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
/*
*----------------------------------------------------------------------
@@ -51,7 +48,7 @@ Pkgb_SubObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
@@ -92,30 +89,10 @@ Pkgb_UnsafeObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL);
}
-
-static int
-Pkgb_DemoObjCmd(
- ClientData dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
-#if (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 4)
- Tcl_Obj *first;
-
- if (Tcl_ListObjIndex(NULL, Tcl_GetEncodingSearchPath(), 0, &first)
- == TCL_OK) {
- Tcl_SetObjResult(interp, first);
- }
-#else
- Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetDefaultEncodingDir(), -1));
-#endif
- return TCL_OK;
-}
/*
*----------------------------------------------------------------------
@@ -141,16 +118,20 @@ Pkgb_Init(
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
+ if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp);
}
code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -178,13 +159,17 @@ Pkgb_SafeInit(
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
+ if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp);
}
code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c
index 983fcf3..6ad5ab4 100644
--- a/unix/dltest/pkgc.c
+++ b/unix/dltest/pkgc.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
@@ -19,9 +18,9 @@
*/
static int Pkgc_SubObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
static int Pkgc_UnsafeObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
/*
*----------------------------------------------------------------------
@@ -45,7 +44,7 @@ Pkgc_SubObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
@@ -83,7 +82,7 @@ Pkgc_UnsafeObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
return TCL_OK;
@@ -106,23 +105,24 @@ Pkgc_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgc_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -143,20 +143,21 @@ Pkgc_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgc_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c
index c708df0..7fe7c49 100644
--- a/unix/dltest/pkgd.c
+++ b/unix/dltest/pkgd.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
@@ -19,9 +18,9 @@
*/
static int Pkgd_SubObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
static int Pkgd_UnsafeObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
/*
*----------------------------------------------------------------------
@@ -45,7 +44,7 @@ Pkgd_SubObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int first, second;
@@ -83,7 +82,7 @@ Pkgd_UnsafeObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
return TCL_OK;
@@ -106,23 +105,24 @@ Pkgd_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgd_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -143,20 +143,21 @@ Pkgd_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgd_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
if (code != TCL_OK) {
return code;
}
- Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, (ClientData) 0,
+ (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c
index f46ca74..abd2359 100644
--- a/unix/dltest/pkge.c
+++ b/unix/dltest/pkge.c
@@ -11,8 +11,8 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
+
/*
*----------------------------------------------------------------------
@@ -31,15 +31,15 @@
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkge_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
- static const char script[] = "if 44 {open non_existent}";
+ static char script[] = "if 44 {open non_existent}";
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
- return Tcl_EvalEx(interp, script, -1, 0);
+ return Tcl_Eval(interp, script);
}
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
deleted file mode 100644
index 5a0b0ef..0000000
--- a/unix/dltest/pkgooa.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * pkgooa.c --
- *
- * This file contains a simple Tcl package "pkgooa" that is intended for
- * testing the Tcl dynamic loading facilities.
- *
- * Copyright (c) 1995 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution of
- * this file, and for a DISCLAIMER OF ALL WARRANTIES.
- */
-
-#undef STATIC_BUILD
-#include "tclOO.h"
-#include <string.h>
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgooa_StubsOKObjCmd --
- *
- * This procedure is invoked to process the "pkgooa_stubsok" Tcl command.
- * It gives 1 if stubs are used correctly, 0 if stubs are not OK.
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-Pkgooa_StubsOKObjCmd(
- ClientData dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
- if (objc != 1) {
- Tcl_WrongNumArgs(interp, 1, objv, "");
- return TCL_ERROR;
- }
- Tcl_SetObjResult(interp, Tcl_NewIntObj(
- Tcl_CopyObjectInstance == tclOOStubsPtr->tcl_CopyObjectInstance));
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Pkgooa_Init --
- *
- * This is a package initialization procedure, which is called by Tcl
- * when this package is to be added to an interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-extern void *tclOOIntStubsPtr;
-
-static TclOOStubs stubsCopy = {
- TCL_STUB_MAGIC,
- NULL,
- /* It doesn't really matter what implementation of
- * Tcl_CopyObjectInstance is put in the "pseudo"
- * stub table, since the test-case never actually
- * calls this function. All that matters is that it's
- * a function with a different memory address than
- * the real Tcl_CopyObjectInstance function in Tcl. */
- (Tcl_Object (*) (Tcl_Interp *, Tcl_Object, const char *,
- const char *t)) Pkgooa_StubsOKObjCmd
- /* More entries could be here, but those are not used
- * for this test-case. So, being NULL is OK. */
-};
-
-extern DLLEXPORT int
-Pkgooa_Init(
- Tcl_Interp *interp) /* Interpreter in which the package is to be
- * made available. */
-{
- int code;
-
- /* Any TclOO extension which uses stubs, calls
- * both Tcl_InitStubs and Tcl_OOInitStubs() and
- * does not use any Tcl 8.6 features should be
- * loadable in Tcl 8.5 as well, provided the
- * TclOO extension (for Tcl 8.5) is installed.
- * This worked in Tcl 8.6.0, and is expected
- * to keep working in all future Tcl 8.x releases.
- */
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
- return TCL_ERROR;
- }
- if (tclStubsPtr == NULL) {
- Tcl_AppendResult(interp, "Tcl stubs are not inialized, "
- "did you compile using -DUSE_TCL_STUBS? ");
- return TCL_ERROR;
- }
- if (Tcl_OOInitStubs(interp) == NULL) {
- return TCL_ERROR;
- }
- if (tclOOStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO stubs are not inialized");
- return TCL_ERROR;
- }
- if (tclOOIntStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO internal stubs are not inialized");
- return TCL_ERROR;
- }
-
- /* Test case for Bug [f51efe99a7].
- *
- * Let tclOOStubsPtr point to an alternate stub table
- * (with only a single function, that's enough for
- * this test). This way, the function "pkgooa_stubsok"
- * can check whether the TclOO function calls really
- * use the stub table, or only pretend to.
- *
- * On platforms without backlinking (Windows, Cygwin,
- * AIX), this code doesn't even compile without using
- * stubs, but on UNIX ELF systems, the problem is
- * less visible.
- */
-
- tclOOStubsPtr = &stubsCopy;
-
- code = Tcl_PkgProvide(interp, "Pkgooa", "1.0");
- if (code != TCL_OK) {
- return code;
- }
- Tcl_CreateObjCommand(interp, "pkgooa_stubsok", Pkgooa_StubsOKObjCmd, NULL, NULL);
- return TCL_OK;
-}
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 9d5a9d9..9c36e88 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -18,9 +18,9 @@
*/
static int PkguaEqObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
static int PkguaQuoteObjCmd(ClientData clientData,
- Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
/*
* In the following hash table we are going to store a struct that holds all
@@ -49,7 +49,7 @@ PkguaInitTokensHashTable(void)
interpTokenMapInitialised = 1;
}
-static void
+void
PkguaFreeTokensHashTable(void)
{
Tcl_HashSearch search;
@@ -69,7 +69,7 @@ PkguaInterpToTokens(
int newEntry;
Tcl_Command *cmdTokens;
Tcl_HashEntry *entryPtr =
- Tcl_CreateHashEntry(&interpTokenMap, interp, &newEntry);
+ Tcl_CreateHashEntry(&interpTokenMap, (char *) interp, &newEntry);
if (newEntry) {
cmdTokens = (Tcl_Command *)
@@ -77,7 +77,7 @@ PkguaInterpToTokens(
for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS+1 ; ++newEntry) {
cmdTokens[newEntry] = NULL;
}
- Tcl_SetHashValue(entryPtr, cmdTokens);
+ Tcl_SetHashValue(entryPtr, (ClientData) cmdTokens);
} else {
cmdTokens = (Tcl_Command *) Tcl_GetHashValue(entryPtr);
}
@@ -89,7 +89,7 @@ PkguaDeleteTokens(
Tcl_Interp *interp)
{
Tcl_HashEntry *entryPtr =
- Tcl_FindHashEntry(&interpTokenMap, interp);
+ Tcl_FindHashEntry(&interpTokenMap, (char *) interp);
if (entryPtr) {
Tcl_Free((char *) Tcl_GetHashValue(entryPtr));
@@ -120,10 +120,10 @@ PkguaEqObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
int result;
- const char *str1, *str2;
+ CONST char *str1, *str2;
int len1, len2;
if (objc != 3) {
@@ -164,7 +164,7 @@ PkguaQuoteObjCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument strings. */
+ Tcl_Obj *CONST objv[]) /* Argument strings. */
{
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "value");
@@ -191,7 +191,7 @@ PkguaQuoteObjCmd(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -199,7 +199,7 @@ Pkgua_Init(
int code, cmdIndex = 0;
Tcl_Command *cmdTokens;
- if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+ if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
@@ -215,15 +215,15 @@ Pkgua_Init(
return code;
}
- Tcl_SetVar2(interp, "::pkgua_loaded", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_loaded", ".", TCL_APPEND_VALUE);
cmdTokens = PkguaInterpToTokens(interp);
cmdTokens[cmdIndex++] =
- Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
cmdTokens[cmdIndex++] =
Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd,
- NULL, NULL);
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
return TCL_OK;
}
@@ -244,7 +244,7 @@ Pkgua_Init(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -269,7 +269,7 @@ Pkgua_SafeInit(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_Unload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
@@ -290,7 +290,7 @@ Pkgua_Unload(
PkguaDeleteTokens(interp);
- Tcl_SetVar2(interp, "::pkgua_detached", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_detached", ".", TCL_APPEND_VALUE);
if (flags == TCL_UNLOAD_DETACH_FROM_PROCESS) {
/*
@@ -300,7 +300,7 @@ Pkgua_Unload(
*/
PkguaFreeTokensHashTable();
- Tcl_SetVar2(interp, "::pkgua_unloaded", NULL, ".", TCL_APPEND_VALUE);
+ Tcl_SetVar(interp, "::pkgua_unloaded", ".", TCL_APPEND_VALUE);
}
return TCL_OK;
}
@@ -322,7 +322,7 @@ Pkgua_Unload(
*----------------------------------------------------------------------
*/
-DLLEXPORT int
+int
Pkgua_SafeUnload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */