summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/DString.317
-rw-r--r--generic/tcl.decls8
-rw-r--r--generic/tclCmdAH.c4
-rw-r--r--generic/tclDecls.h14
-rw-r--r--generic/tclFileName.c6
-rw-r--r--generic/tclInt.h1
-rw-r--r--generic/tclMain.c2
-rw-r--r--generic/tclPathObj.c4
-rw-r--r--generic/tclRegexp.c2
-rw-r--r--generic/tclStubInit.c4
-rw-r--r--generic/tclTest.c9
-rw-r--r--generic/tclUtil.c6
-rw-r--r--generic/tclZlib.c4
-rw-r--r--tests/chanio.test1
-rw-r--r--tests/dstring.test39
-rw-r--r--tests/env.test2
-rw-r--r--tests/exec.test4
-rw-r--r--tests/fileSystemEncoding.test15
-rw-r--r--tests/io.test1
-rw-r--r--tests/ioCmd.test1
-rw-r--r--tests/platform.test2
-rw-r--r--tests/regexp.test2
-rw-r--r--tests/string.test3
-rw-r--r--tests/tcltests.tcl3
-rw-r--r--tests/thread.test3
-rw-r--r--tests/winDde.test2
-rw-r--r--unix/tclUnixFCmd.c4
-rw-r--r--unix/tclUnixFile.c4
-rw-r--r--unix/tclUnixInit.c2
-rw-r--r--win/tclWinFCmd.c6
-rw-r--r--win/tclWinFile.c2
-rw-r--r--win/tclWinInit.c2
32 files changed, 125 insertions, 54 deletions
diff --git a/doc/DString.3 b/doc/DString.3
index cbce13f..5c4d8f4 100644
--- a/doc/DString.3
+++ b/doc/DString.3
@@ -39,6 +39,10 @@ char *
\fBTcl_DStringResult\fR(\fIinterp, dsPtr\fR)
.sp
\fBTcl_DStringGetResult\fR(\fIinterp, dsPtr\fR)
+.sp
+Tcl_Obj *
+\fBTcl_DStringToObj\fR(\fIdsPtr\fR)
+.sp
.SH ARGUMENTS
.AS Tcl_DString newLength in/out
.AP Tcl_DString *dsPtr in/out
@@ -136,12 +140,25 @@ a pointer from \fIdsPtr\fR to the interpreter's result.
This saves the cost of allocating new memory and copying the string.
\fBTcl_DStringResult\fR also reinitializes the dynamic string to
an empty string.
+Since the dynamic string is reinitialized, there is no need to
+further call \fBTcl_DStringFree\fR on it and it can be reused without
+calling \fBTcl_DStringInit\fR.
.PP
\fBTcl_DStringGetResult\fR does the opposite of \fBTcl_DStringResult\fR.
It sets the value of \fIdsPtr\fR to the result of \fIinterp\fR and
it clears \fIinterp\fR's result.
If possible it does this by moving a pointer rather than by copying
the string.
+.PP
+\fBTcl_DStringToObj\fR returns a \fBTcl_Obj\fR containing the value of
+the dynamic string given by \fIdsPtr\fR. It does this by moving
+a pointer from \fIdsPtr\fR to a newly allocated \fBTcl_Obj\fR
+and reinitializing to dynamic string to an empty string.
+This saves the cost of allocating new memory and copying the string.
+Since the dynamic string is reinitialized, there is no need to
+further call \fBTcl_DStringFree\fR on it and it can be reused without
+calling \fBTcl_DStringInit\fR.
+The returned \fBTcl_Obj\fR has a reference count of 0.
.SH KEYWORDS
append, dynamic string, free, result
diff --git a/generic/tcl.decls b/generic/tcl.decls
index e0b4ab5..8e77e49 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2625,10 +2625,10 @@ declare 683 {
# Tcl_WideUInt *uwidePtr)
#}
-# TIP 651 (reserved)
-#declare 687 {
-# Tcl_Obj *Tcl_DStringToObj(Tcl_DString *dsPtr)
-#}
+# TIP 651
+declare 687 {
+ Tcl_Obj *Tcl_DStringToObj(Tcl_DString *dsPtr)
+}
# ----- BASELINE -- FOR -- 8.7.0 / 9.0.0 ----- #
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index aa898ea..a5384fd 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -511,7 +511,7 @@ EncodingConvertfromObjCmd(
* truncate the string at the first null byte.
*/
- Tcl_SetObjResult(interp, TclDStringToObj(&ds));
+ Tcl_SetObjResult(interp, Tcl_DStringToObj(&ds));
/*
* We're done with the encoding
@@ -1912,7 +1912,7 @@ PathNativeNameCmd(
if (Tcl_TranslateFileName(interp, TclGetString(objv[1]), &ds) == NULL) {
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, TclDStringToObj(&ds));
+ Tcl_SetObjResult(interp, Tcl_DStringToObj(&ds));
return TCL_OK;
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 90105bc..faada2a 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1852,6 +1852,11 @@ EXTERN int Tcl_RemoveChannelMode(Tcl_Interp *interp,
Tcl_Channel chan, int mode);
/* 683 */
EXTERN int Tcl_GetEncodingNulLength(Tcl_Encoding encoding);
+/* Slot 684 is reserved */
+/* Slot 685 is reserved */
+/* Slot 686 is reserved */
+/* 687 */
+EXTERN Tcl_Obj * Tcl_DStringToObj(Tcl_DString *dsPtr);
typedef struct {
const struct TclPlatStubs *tclPlatStubs;
@@ -2547,6 +2552,10 @@ typedef struct TclStubs {
int (*tcl_GetNumber) (Tcl_Interp *interp, const char *bytes, size_t numBytes, void **clientDataPtr, int *typePtr); /* 681 */
int (*tcl_RemoveChannelMode) (Tcl_Interp *interp, Tcl_Channel chan, int mode); /* 682 */
int (*tcl_GetEncodingNulLength) (Tcl_Encoding encoding); /* 683 */
+ void (*reserved684)(void);
+ void (*reserved685)(void);
+ void (*reserved686)(void);
+ Tcl_Obj * (*tcl_DStringToObj) (Tcl_DString *dsPtr); /* 687 */
} TclStubs;
extern const TclStubs *tclStubsPtr;
@@ -3867,6 +3876,11 @@ extern const TclStubs *tclStubsPtr;
(tclStubsPtr->tcl_RemoveChannelMode) /* 682 */
#define Tcl_GetEncodingNulLength \
(tclStubsPtr->tcl_GetEncodingNulLength) /* 683 */
+/* Slot 684 is reserved */
+/* Slot 685 is reserved */
+/* Slot 686 is reserved */
+#define Tcl_DStringToObj \
+ (tclStubsPtr->tcl_DStringToObj) /* 687 */
#endif /* defined(USE_TCL_STUBS) */
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 040f0fd..168355a 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -428,7 +428,7 @@ TclpGetNativePathType(
if ((rootEnd != path) && (driveNameLengthPtr != NULL)) {
*driveNameLengthPtr = rootEnd - path;
if (driveNameRef != NULL) {
- *driveNameRef = TclDStringToObj(&ds);
+ *driveNameRef = Tcl_DStringToObj(&ds);
Tcl_IncrRefCount(*driveNameRef);
}
}
@@ -701,7 +701,7 @@ SplitWinPath(
*/
if (p != path) {
- Tcl_ListObjAppendElement(NULL, result, TclDStringToObj(&buf));
+ Tcl_ListObjAppendElement(NULL, result, Tcl_DStringToObj(&buf));
}
Tcl_DStringFree(&buf);
@@ -2241,7 +2241,7 @@ DoGlob(
*/
if (pathPtr == NULL) {
- joinedPtr = TclDStringToObj(&append);
+ joinedPtr = Tcl_DStringToObj(&append);
} else if (flags) {
joinedPtr = TclNewFSPathObj(pathPtr, Tcl_DStringValue(&append),
Tcl_DStringLength(&append));
diff --git a/generic/tclInt.h b/generic/tclInt.h
index adf02b7..025fb52 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3113,7 +3113,6 @@ MODULE_SCOPE char * TclDStringAppendObj(Tcl_DString *dsPtr,
Tcl_Obj *objPtr);
MODULE_SCOPE char * TclDStringAppendDString(Tcl_DString *dsPtr,
Tcl_DString *toAppendPtr);
-MODULE_SCOPE Tcl_Obj * TclDStringToObj(Tcl_DString *dsPtr);
MODULE_SCOPE Tcl_Obj *const *TclFetchEnsembleRoot(Tcl_Interp *interp,
Tcl_Obj *const *objv, size_t objc, size_t *objcPtr);
MODULE_SCOPE Tcl_Obj *const *TclEnsembleGetRewriteValues(Tcl_Interp *interp);
diff --git a/generic/tclMain.c b/generic/tclMain.c
index 41278da..bb77e28 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -55,7 +55,7 @@ NewNativeObj(
#else
(void)Tcl_ExternalToUtfDString(NULL, (char *)string, -1, &ds);
#endif
- return TclDStringToObj(&ds);
+ return Tcl_DStringToObj(&ds);
}
/*
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 17bbc46..d0826b7 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2514,7 +2514,7 @@ TclGetHomeDirObj(
if (MakeTildeRelativePath(interp, user, NULL, &dirString) != TCL_OK) {
return NULL;
}
- return TclDStringToObj(&dirString);
+ return Tcl_DStringToObj(&dirString);
}
/*
@@ -2586,7 +2586,7 @@ TclResolveTildePath(
}
Tcl_DStringFree(&userName);
}
- return TclDStringToObj(&resolvedPath);
+ return Tcl_DStringToObj(&resolvedPath);
}
/*
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index 39c7ad2..4e3c6c5 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -960,7 +960,7 @@ CompileRegexp(
if (TclReToGlob(NULL, string, length, &stringBuf, &exact,
NULL) == TCL_OK) {
- regexpPtr->globObjPtr = TclDStringToObj(&stringBuf);
+ regexpPtr->globObjPtr = Tcl_DStringToObj(&stringBuf);
Tcl_IncrRefCount(regexpPtr->globObjPtr);
} else {
regexpPtr->globObjPtr = NULL;
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 2f1eb88..623407b 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -1489,6 +1489,10 @@ const TclStubs tclStubs = {
Tcl_GetNumber, /* 681 */
Tcl_RemoveChannelMode, /* 682 */
Tcl_GetEncodingNulLength, /* 683 */
+ 0, /* 684 */
+ 0, /* 685 */
+ 0, /* 686 */
+ Tcl_DStringToObj, /* 687 */
};
/* !END!: Do not edit above this line. */
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 5d76afd..869ab1d 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -1904,6 +1904,11 @@ TestdstringCmd(
goto wrongNumArgs;
}
Tcl_DStringResult(interp, &dstring);
+ } else if (strcmp(argv[1], "toobj") == 0) {
+ if (argc != 2) {
+ goto wrongNumArgs;
+ }
+ Tcl_SetObjResult(interp, Tcl_DStringToObj(&dstring));
} else if (strcmp(argv[1], "trunc") == 0) {
if (argc != 3) {
goto wrongNumArgs;
@@ -1919,8 +1924,8 @@ TestdstringCmd(
Tcl_DStringStartSublist(&dstring);
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be append, element, end, free, get, length, "
- "result, trunc, or start", NULL);
+ "\": must be append, element, end, free, get, gresult, length, "
+ "result, start, toobj, or trunc", NULL);
return TCL_ERROR;
}
return TCL_OK;
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index aa5f9e8..0b898f1 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2872,7 +2872,7 @@ Tcl_DStringResult(
Tcl_DString *dsPtr) /* Dynamic string that is to become the
* result of interp. */
{
- Tcl_SetObjResult(interp, TclDStringToObj(dsPtr));
+ Tcl_SetObjResult(interp, Tcl_DStringToObj(dsPtr));
}
/*
@@ -2912,7 +2912,7 @@ Tcl_DStringGetResult(
/*
*----------------------------------------------------------------------
*
- * TclDStringToObj --
+ * Tcl_DStringToObj --
*
* This function moves a dynamic string's contents to a new Tcl_Obj. Be
* aware that this function does *not* check that the encoding of the
@@ -2932,7 +2932,7 @@ Tcl_DStringGetResult(
*/
Tcl_Obj *
-TclDStringToObj(
+Tcl_DStringToObj(
Tcl_DString *dsPtr)
{
Tcl_Obj *result;
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 5effcb5..1077b7c 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -549,7 +549,7 @@ ExtractHeader(
Tcl_ExternalToUtfDStringEx(latin1enc, (char *) headerPtr->comment, -1,
TCL_ENCODING_NOCOMPLAIN, &tmp);
- SetValue(dictObj, "comment", TclDStringToObj(&tmp));
+ SetValue(dictObj, "comment", Tcl_DStringToObj(&tmp));
}
SetValue(dictObj, "crc", Tcl_NewBooleanObj(headerPtr->hcrc));
if (headerPtr->name != Z_NULL) {
@@ -566,7 +566,7 @@ ExtractHeader(
Tcl_ExternalToUtfDStringEx(latin1enc, (char *) headerPtr->name, -1,
TCL_ENCODING_NOCOMPLAIN, &tmp);
- SetValue(dictObj, "filename", TclDStringToObj(&tmp));
+ SetValue(dictObj, "filename", Tcl_DStringToObj(&tmp));
}
if (headerPtr->os != 255) {
SetValue(dictObj, "os", Tcl_NewWideIntObj(headerPtr->os));
diff --git a/tests/chanio.test b/tests/chanio.test
index 691a2c0..49ac471 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -39,6 +39,7 @@ namespace eval ::tcl::test::io {
package require -exact tcl::test [info patchlevel]
set ::tcltestlib [info loaded {} Tcltest]
}
+ source [file join [file dirname [info script]] tcltests.tcl]
testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testchannel [llength [info commands testchannel]]
diff --git a/tests/dstring.test b/tests/dstring.test
index 11c5754..314cee8 100644
--- a/tests/dstring.test
+++ b/tests/dstring.test
@@ -473,6 +473,45 @@ test dstring-6.5 {Tcl_DStringGetResult} -constraints testdstring -body {
} -cleanup {
testdstring free
} -result {{} {This is a specially-allocated stringz}}
+
+test dstring-7.1 {copying to Tcl_Obj} -constraints testdstring -setup {
+ testdstring free
+} -body {
+ testdstring append xyz -1
+ list [testdstring toobj] [testdstring length]
+} -cleanup {
+ testdstring free
+} -result {xyz 0}
+test dstring-7.2 {copying to a Tcl_Obj} -constraints testdstring -setup {
+ testdstring free
+ unset -nocomplain a
+} -body {
+ foreach l {a b c d e f g h i j k l m n o p} {
+ testdstring append $l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l$l\n -1
+ }
+ set a [testdstring toobj]
+ testdstring append abc -1
+ list $a [testdstring get]
+} -cleanup {
+ testdstring free
+} -result {{aaaaaaaaaaaaaaaaaaaaa
+bbbbbbbbbbbbbbbbbbbbb
+ccccccccccccccccccccc
+ddddddddddddddddddddd
+eeeeeeeeeeeeeeeeeeeee
+fffffffffffffffffffff
+ggggggggggggggggggggg
+hhhhhhhhhhhhhhhhhhhhh
+iiiiiiiiiiiiiiiiiiiii
+jjjjjjjjjjjjjjjjjjjjj
+kkkkkkkkkkkkkkkkkkkkk
+lllllllllllllllllllll
+mmmmmmmmmmmmmmmmmmmmm
+nnnnnnnnnnnnnnnnnnnnn
+ooooooooooooooooooooo
+ppppppppppppppppppppp
+} abc}
+
# cleanup
if {[testConstraint testdstring]} {
diff --git a/tests/env.test b/tests/env.test
index b36b049..bf3d9a1 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -16,6 +16,8 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
+source [file join [file dirname [info script]] tcltests.tcl]
+
# [exec] is required here to see the actual environment received by child
# processes.
proc getenv {} {
diff --git a/tests/exec.test b/tests/exec.test
index e8ba6b2..3e25360 100644
--- a/tests/exec.test
+++ b/tests/exec.test
@@ -18,10 +18,8 @@ if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
}
+source [file join [file dirname [info script]] tcltests.tcl]
-# All tests require the "exec" command.
-# Skip them if exec is not defined.
-testConstraint exec [llength [info commands exec]]
# Some skips when running in a macOS CI environment
testConstraint noosxCI [expr {![info exists ::env(MAC_CI)]}]
diff --git a/tests/fileSystemEncoding.test b/tests/fileSystemEncoding.test
index c9d36d2..f47635d 100644
--- a/tests/fileSystemEncoding.test
+++ b/tests/fileSystemEncoding.test
@@ -15,20 +15,7 @@ namespace eval ::tcl::test::fileSystemEncoding {
variable fname1 登鸛鵲樓
- proc autopath {} {
- global auto_path
- set scriptpath [info script]
- set scriptpathnorm [file dirname [file normalize $scriptpath/...]]
- set dirnorm [file dirname $scriptpathnorm]
- set idx [lsearch -exact $auto_path $dirnorm]
- if {$idx >= 0} {
- set auto_path [lreplace $auto_path[set auto_path {}] $idx $idx {}]
- }
- set auto_path [linsert $auto_path[set auto_path {}] 0 0 $dirnorm]
- }
- autopath
-
- package require tcltests
+ source [file join [file dirname [info script]] tcltests.tcl]
test filesystemEncoding-1.0 {
issue bcd100410465
diff --git a/tests/io.test b/tests/io.test
index d5a39c7..497c6ba 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -34,6 +34,7 @@ namespace eval ::tcl::test::io {
package require -exact tcl::test [info patchlevel]
set ::tcltestlib [info loaded {} Tcltest]
}
+ source [file join [file dirname [info script]] tcltests.tcl]
testConstraint testbytestring [llength [info commands testbytestring]]
testConstraint testchannel [llength [info commands testchannel]]
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 0e6a8e9..690b196 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -17,6 +17,7 @@ if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
}
+source [file join [file dirname [info script]] tcltests.tcl]
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
diff --git a/tests/platform.test b/tests/platform.test
index b5fd405..33aea3a 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -10,6 +10,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require tcltest 2.5
+source [file join [file dirname [info script]] tcltests.tcl]
namespace eval ::tcl::test::platform {
namespace import ::tcltest::testConstraint
@@ -22,7 +23,6 @@ namespace eval ::tcl::test::platform {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
-package require tcltests
testConstraint testCPUID [llength [info commands testcpuid]]
testConstraint testlongsize [llength [info commands testlongsize]]
diff --git a/tests/regexp.test b/tests/regexp.test
index 2737583..b06c163 100644
--- a/tests/regexp.test
+++ b/tests/regexp.test
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
unset -nocomplain foo
-package require tcltests
+source [file join [file dirname [info script]] tcltests.tcl]
testConstraint exec [llength [info commands exec]]
# Used for constraining memory leak tests
diff --git a/tests/string.test b/tests/string.test
index 8769556..045d466 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -19,7 +19,8 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
-package require tcltests
+source [file join [file dirname [info script]] tcltests.tcl]
+
# Helper commands to test various optimizations, code paths, and special cases.
proc makeByteArray {s} {binary format a* $s}
diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl
index cc0d6a7..a2251bf 100644
--- a/tests/tcltests.tcl
+++ b/tests/tcltests.tcl
@@ -1,5 +1,8 @@
#! /usr/bin/env tclsh
+# Don't overwrite tcltests facilities already present
+if {[package provide tcltests] ne {}} return
+
package require tcltest 2.5
namespace import ::tcltest::*
testConstraint exec [llength [info commands exec]]
diff --git a/tests/thread.test b/tests/thread.test
index 22c1a4f..636d7a8 100644
--- a/tests/thread.test
+++ b/tests/thread.test
@@ -20,11 +20,10 @@ if {"::tcltest" ni [namespace children]} {
# be fully finalized, which avoids valgrind "still reachable" reports.
package require tcltest 2.5
-namespace import ::tcltest::*
+source [file join [file dirname [info script]] tcltests.tcl]
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
-package require tcltests
# Some tests require the testthread command
diff --git a/tests/winDde.test b/tests/winDde.test
index ad21426..c56d27d 100644
--- a/tests/winDde.test
+++ b/tests/winDde.test
@@ -13,7 +13,7 @@ if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
}
-package require tcltests
+source [file join [file dirname [info script]] tcltests.tcl]
testConstraint dde 0
if {[testConstraint win]} {
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 8109198..b205061 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -1425,7 +1425,7 @@ GetOwnerAttribute(
Tcl_DString ds;
Tcl_ExternalToUtfDStringEx(NULL, pwPtr->pw_name, TCL_INDEX_NONE, TCL_ENCODING_NOCOMPLAIN, &ds);
- *attributePtrPtr = TclDStringToObj(&ds);
+ *attributePtrPtr = Tcl_DStringToObj(&ds);
}
return TCL_OK;
}
@@ -2345,7 +2345,7 @@ TclpCreateTemporaryDirectory(
Tcl_ExternalToUtfDStringEx(NULL, Tcl_DStringValue(&templ),
Tcl_DStringLength(&templ), TCL_ENCODING_NOCOMPLAIN, &tmp);
Tcl_DStringFree(&templ);
- return TclDStringToObj(&tmp);
+ return Tcl_DStringToObj(&tmp);
}
#if defined(__CYGWIN__)
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 780f1ea..50e82c2 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -997,7 +997,7 @@ TclpObjLink(
}
Tcl_ExternalToUtfDStringEx(NULL, link, length, TCL_ENCODING_NOCOMPLAIN, &ds);
- linkPtr = TclDStringToObj(&ds);
+ linkPtr = Tcl_DStringToObj(&ds);
Tcl_IncrRefCount(linkPtr);
return linkPtr;
}
@@ -1062,7 +1062,7 @@ TclpNativeToNormalized(
Tcl_DString ds;
Tcl_ExternalToUtfDStringEx(NULL, (const char *) clientData, TCL_INDEX_NONE, TCL_ENCODING_NOCOMPLAIN, &ds);
- return TclDStringToObj(&ds);
+ return Tcl_DStringToObj(&ds);
}
/*
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 148caa0..995bd83 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -510,7 +510,7 @@ TclpInitLibraryPath(
pathv[pathc - 1] = installLib + 4;
str = Tcl_JoinPath(pathc, pathv, &ds);
- Tcl_ListObjAppendElement(NULL, pathPtr, TclDStringToObj(&ds));
+ Tcl_ListObjAppendElement(NULL, pathPtr, Tcl_DStringToObj(&ds));
}
Tcl_Free(pathv);
}
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index e52874e..cb78330 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -1002,7 +1002,7 @@ TclpObjRemoveDirectory(
!strcmp(Tcl_DStringValue(&ds), TclGetString(normPtr))) {
*errorPtr = pathPtr;
} else {
- *errorPtr = TclDStringToObj(&ds);
+ *errorPtr = Tcl_DStringToObj(&ds);
}
Tcl_IncrRefCount(*errorPtr);
}
@@ -1715,7 +1715,7 @@ ConvertFileNameFormat(
Tcl_WCharToUtfDString(nativeName, TCL_INDEX_NONE, &dsTemp);
Tcl_DStringFree(&ds);
- tempPath = TclDStringToObj(&dsTemp);
+ tempPath = Tcl_DStringToObj(&dsTemp);
Tcl_ListObjReplace(NULL, splitPath, i, 1, 1, &tempPath);
FindClose(handle);
}
@@ -2069,7 +2069,7 @@ TclpCreateTemporaryDirectory(
Tcl_DStringInit(&name);
Tcl_WCharToUtfDString((LPCWSTR) Tcl_DStringValue(&base), TCL_INDEX_NONE, &name);
Tcl_DStringFree(&base);
- return TclDStringToObj(&name);
+ return Tcl_DStringToObj(&name);
}
/*
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 3bb3117..549133c 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -2483,7 +2483,7 @@ TclpFilesystemPathType(
Tcl_DStringInit(&ds);
Tcl_WCharToUtfDString(volType, TCL_INDEX_NONE, &ds);
- return TclDStringToObj(&ds);
+ return Tcl_DStringToObj(&ds);
}
#undef VOL_BUF_SIZE
}
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index b7b5c0d..a7e82de 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -255,7 +255,7 @@ AppendEnvironment(
pathv[pathc - 1] = shortlib;
Tcl_DStringInit(&ds);
(void) Tcl_JoinPath(pathc, pathv, &ds);
- objPtr = TclDStringToObj(&ds);
+ objPtr = Tcl_DStringToObj(&ds);
} else {
objPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE);
}