summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-03 11:47:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-12-03 11:47:10 (GMT)
commita87c2925c5ff1caf3a88c8a249aae82699d7f5a0 (patch)
tree897cb417189707ae97647340f9d251c02567595a
parent2c9a791c2fe6b087b0bee9b3c18fa51df58fe0ab (diff)
downloadtcl-a87c2925c5ff1caf3a88c8a249aae82699d7f5a0.zip
tcl-a87c2925c5ff1caf3a88c8a249aae82699d7f5a0.tar.gz
tcl-a87c2925c5ff1caf3a88c8a249aae82699d7f5a0.tar.bz2
deprecate Tcl_Backslash, Tcl_GetDefaultEncodingDir and Tcl_SetDefaultEncodingDir
-rw-r--r--generic/tclDecls.h3
-rw-r--r--generic/tclEncoding.c5
-rw-r--r--generic/tclStubInit.c3
-rw-r--r--generic/tclUtil.c3
-rw-r--r--tests/encoding.test12
-rw-r--r--tests/unixInit.test7
-rw-r--r--unix/tclUnixTest.c73
7 files changed, 12 insertions, 94 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index c5de111..473f3dc 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -3810,6 +3810,9 @@ extern const TclStubs *tclStubsPtr;
# undef Tcl_CreateMathFunc
# undef Tcl_GetMathFuncInfo
# undef Tcl_ListMathFuncs
+# undef Tcl_Backslash
+# undef Tcl_GetDefaultEncodingDir
+# undef Tcl_SetDefaultEncodingDir
#endif
#endif /* _TCLDECLS */
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 7a55724..6bc7377 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -686,7 +686,7 @@ TclFinalizeEncodingSubsystem(void)
*
*-------------------------------------------------------------------------
*/
-
+#ifndef TCL_NO_DEPRECATED
const char *
Tcl_GetDefaultEncodingDir(void)
{
@@ -701,6 +701,7 @@ Tcl_GetDefaultEncodingDir(void)
return Tcl_GetString(first);
}
+#endif /* TCL_NO_DEPRECATED */
/*
*-------------------------------------------------------------------------
@@ -719,6 +720,7 @@ Tcl_GetDefaultEncodingDir(void)
*-------------------------------------------------------------------------
*/
+#ifndef TCL_NO_DEPRECATED
void
Tcl_SetDefaultEncodingDir(
const char *path)
@@ -730,6 +732,7 @@ Tcl_SetDefaultEncodingDir(
Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory);
Tcl_SetEncodingSearchPath(searchPath);
}
+#endif /* TCL_NO_DEPRECATED */
/*
*-------------------------------------------------------------------------
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 8a428be..58effa9 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -50,6 +50,9 @@
# define TclSockMinimumBuffersOld 0
# define Tcl_SeekOld 0
# define Tcl_TellOld 0
+# define Tcl_Backslash 0
+# define Tcl_GetDefaultEncodingDir 0
+# define Tcl_SetDefaultEncodingDir 0
#else
/* See bug 510001: TclSockMinimumBuffers needs plat imp */
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 13e54ec..15e00a5 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1571,7 +1571,7 @@ Tcl_Merge(
*
*----------------------------------------------------------------------
*/
-
+#ifndef TCL_NO_DEPRECATED
char
Tcl_Backslash(
const char *src, /* Points to the backslash character of a
@@ -1586,6 +1586,7 @@ Tcl_Backslash(
TclUtfToUniChar(buf, &ch);
return (char) ch;
}
+#endif /* TCL_NO_DEPRECATED */
/*
*----------------------------------------------------------------------
diff --git a/tests/encoding.test b/tests/encoding.test
index 0374e2d..687887b 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -35,7 +35,6 @@ proc runtests {} {
# Some tests require the testencoding command
testConstraint testencoding [llength [info commands testencoding]]
testConstraint exec [llength [info commands exec]]
-testConstraint testgetdefenc [llength [info commands testgetdefenc]]
# TclInitEncodingSubsystem is tested by the rest of this file
# TclFinalizeEncodingSubsystem is not currently tested
@@ -570,17 +569,6 @@ foreach from {cp932 shiftjis euc-jp iso2022-jp} {
}
}
-test encoding-26.0 {Tcl_GetDefaultEncodingDir} -constraints {
- testgetdefenc
-} -setup {
- set origDir [testgetdefenc]
- testsetdefenc slappy
-} -body {
- testgetdefenc
-} -cleanup {
- testsetdefenc $origDir
-} -result slappy
-
file delete {*}[glob -directory [temporaryDirectory] *.chars *.tcltestout]
# ===> Cut here <===
diff --git a/tests/unixInit.test b/tests/unixInit.test
index 9ba9c11..4804d78 100644
--- a/tests/unixInit.test
+++ b/tests/unixInit.test
@@ -87,13 +87,6 @@ test unixInit-1.2 {initialisation: standard channel type deduction} {unix stdio}
skip [concat [skip] unixInit-2.*]
-test unixInit-2.0 {TclpInitLibraryPath: setting tclDefaultEncodingDir} {
- set origDir [testgetdefenc]
- testsetdefenc slappy
- set path [testgetdefenc]
- testsetdefenc $origDir
- set path
-} {slappy}
test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -setup {
unset -nocomplain oldlibrary
if {[info exists env(TCL_LIBRARY)]} {
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index 46fc972..249ee51 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -67,10 +67,8 @@ static Tcl_CmdProc TestchmodCmd;
static Tcl_CmdProc TestfilehandlerCmd;
static Tcl_CmdProc TestfilewaitCmd;
static Tcl_CmdProc TestfindexecutableCmd;
-static Tcl_CmdProc TestgetdefencdirCmd;
static Tcl_CmdProc TestgetopenfileCmd;
static Tcl_CmdProc TestgotsigCmd;
-static Tcl_CmdProc TestsetdefencdirCmd;
static Tcl_FileProc TestFileHandlerProc;
static void AlarmHandler(int signum);
@@ -105,10 +103,6 @@ TclplatformtestInit(
NULL, NULL);
Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
- NULL, NULL);
- Tcl_CreateCommand(interp, "testsetdefenc", TestsetdefencdirCmd,
- NULL, NULL);
Tcl_CreateCommand(interp, "testalarm", TestalarmCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testgotsig", TestgotsigCmd,
@@ -496,73 +490,6 @@ TestgetopenfileCmd(
/*
*----------------------------------------------------------------------
*
- * TestsetdefencdirCmd --
- *
- * This function implements the "testsetdefenc" command. It is used to
- * test Tcl_SetDefaultEncodingDir().
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestsetdefencdirCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
-{
- if (argc != 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " defaultDir\"", NULL);
- return TCL_ERROR;
- }
-
- Tcl_SetDefaultEncodingDir(argv[1]);
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TestgetdefencdirCmd --
- *
- * This function implements the "testgetdefenc" command. It is used to
- * test Tcl_GetDefaultEncodingDir().
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-static int
-TestgetdefencdirCmd(
- ClientData clientData, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
-{
- if (argc != 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], NULL);
- return TCL_ERROR;
- }
-
- Tcl_AppendResult(interp, Tcl_GetDefaultEncodingDir(), NULL);
- return TCL_OK;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TestalarmCmd --
*
* Test that EINTR is handled correctly by generating and handling a