summaryrefslogtreecommitdiffstats
path: root/unix/dltest
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-07 16:12:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-07 16:12:37 (GMT)
commit9e39586b58aecac489272148e312ef02d0cee418 (patch)
treec7abd1017a8bf00fed8f33378ab350989c77a567 /unix/dltest
parent925dea4994de1e572a6fc32a4645b2477ecbfa36 (diff)
parenta4a99b73219c5f30bd18f6349427c834691b2c46 (diff)
downloadtcl-9e39586b58aecac489272148e312ef02d0cee418.zip
tcl-9e39586b58aecac489272148e312ef02d0cee418.tar.gz
tcl-9e39586b58aecac489272148e312ef02d0cee418.tar.bz2
merge trunk
Diffstat (limited to 'unix/dltest')
-rw-r--r--unix/dltest/pkgb.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 969401b..2f65536 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -21,6 +21,8 @@ static int Pkgb_SubObjCmd(ClientData clientData,
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[]);
/*
*----------------------------------------------------------------------
@@ -86,6 +88,26 @@ Pkgb_UnsafeObjCmd(
{
return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL);
}
+
+#if (TCL_MAJOR_VERSION > 8)
+# define Tcl_GetDefaultEncodingDir ((const char *(*)(void)) \
+ ((&(tclStubsPtr->tcl_PkgProvideEx))[341]))
+#endif
+
+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_GetDefaultEncodingDir) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("not supported", -1));
+ return TCL_ERROR;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetDefaultEncodingDir(), -1));
+ return TCL_OK;
+}
/*
*----------------------------------------------------------------------
@@ -119,8 +141,8 @@ Pkgb_Init(
return code;
}
Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL,
- NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "pkgb_demo", Pkgb_DemoObjCmd, NULL, NULL);
return TCL_OK;
}