summaryrefslogtreecommitdiffstats
path: root/win/tclWinFCmd.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-05 09:03:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-07-05 09:03:12 (GMT)
commit30b0dabb9b5092b7453ff56eae75c009f30eaa1f (patch)
treee95abf5ef1adf6677e12d167fb247fc671a8d556 /win/tclWinFCmd.c
parent26a830241ea90ce41d6cddc8f2a720f4cc5b2e73 (diff)
downloadtcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.zip
tcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.tar.gz
tcl-30b0dabb9b5092b7453ff56eae75c009f30eaa1f.tar.bz2
Improvement: always export both 16-bit and 32-bit UTF function
Diffstat (limited to 'win/tclWinFCmd.c')
-rw-r--r--win/tclWinFCmd.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index b3d1ece..f8fa463 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -330,8 +330,8 @@ DoRenameFile(
Tcl_DStringInit(&srcString);
Tcl_DStringInit(&dstString);
- src = Tcl_Utf16ToUtfDString(nativeSrcPath, -1, &srcString);
- dst = Tcl_Utf16ToUtfDString(nativeDstPath, -1, &dstString);
+ src = Tcl_WCharToUtfDString(nativeSrcPath, -1, &srcString);
+ dst = Tcl_WCharToUtfDString(nativeDstPath, -1, &dstString);
/*
* Check whether the destination path is actually inside the
@@ -915,8 +915,8 @@ TclpObjCopyDirectory(
Tcl_DStringInit(&srcString);
Tcl_DStringInit(&dstString);
- Tcl_UtfToUtf16DString(Tcl_GetString(normSrcPtr), -1, &srcString);
- Tcl_UtfToUtf16DString(Tcl_GetString(normDestPtr), -1, &dstString);
+ Tcl_UtfToWCharDString(Tcl_GetString(normSrcPtr), -1, &srcString);
+ Tcl_UtfToWCharDString(Tcl_GetString(normDestPtr), -1, &dstString);
ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds);
@@ -989,7 +989,7 @@ TclpObjRemoveDirectory(
return TCL_ERROR;
}
Tcl_DStringInit(&native);
- Tcl_UtfToUtf16DString(Tcl_GetString(normPtr), -1, &native);
+ Tcl_UtfToWCharDString(Tcl_GetString(normPtr), -1, &native);
ret = DoRemoveDirectory(&native, recursive, &ds);
Tcl_DStringFree(&native);
} else {
@@ -1117,7 +1117,7 @@ DoRemoveJustDirectory(
char *p;
Tcl_DStringInit(errorPtr);
- p = Tcl_Utf16ToUtfDString(nativePath, -1, errorPtr);
+ p = Tcl_WCharToUtfDString(nativePath, -1, errorPtr);
for (; *p; ++p) {
if (*p == '\\') *p = '/';
}
@@ -1332,7 +1332,7 @@ TraverseWinTree(
TclWinConvertError(GetLastError());
if (errorPtr != NULL) {
Tcl_DStringInit(errorPtr);
- Tcl_Utf16ToUtfDString(nativeErrfile, -1, errorPtr);
+ Tcl_WCharToUtfDString(nativeErrfile, -1, errorPtr);
}
result = TCL_ERROR;
}
@@ -1398,7 +1398,7 @@ TraversalCopy(
if (errorPtr != NULL) {
Tcl_DStringInit(errorPtr);
- Tcl_Utf16ToUtfDString(nativeDst, -1, errorPtr);
+ Tcl_WCharToUtfDString(nativeDst, -1, errorPtr);
}
return TCL_ERROR;
}
@@ -1454,7 +1454,7 @@ TraversalDelete(
if (errorPtr != NULL) {
Tcl_DStringInit(errorPtr);
- Tcl_Utf16ToUtfDString(nativeSrc, -1, errorPtr);
+ Tcl_WCharToUtfDString(nativeSrc, -1, errorPtr);
}
return TCL_ERROR;
}
@@ -1663,7 +1663,7 @@ ConvertFileNameFormat(
tempString = TclGetStringFromObj(tempPath, &length);
Tcl_DStringInit(&ds);
- nativeName = Tcl_UtfToUtf16DString(tempString, length, &ds);
+ nativeName = Tcl_UtfToWCharDString(tempString, length, &ds);
Tcl_DecrRefCount(tempPath);
handle = FindFirstFile(nativeName, &data);
if (handle == INVALID_HANDLE_VALUE) {
@@ -1700,7 +1700,7 @@ ConvertFileNameFormat(
}
/*
- * Purify reports a extraneous UMR in Tcl_Utf16ToUtfDString() trying
+ * Purify reports a extraneous UMR in Tcl_WCharToUtfDString() trying
* to dereference nativeName as a Unicode string. I have proven to
* myself that purify is wrong by running the following example
* when nativeName == data.w.cAlternateFileName and noting that
@@ -1712,7 +1712,7 @@ ConvertFileNameFormat(
*/
Tcl_DStringInit(&dsTemp);
- Tcl_Utf16ToUtfDString(nativeName, -1, &dsTemp);
+ Tcl_WCharToUtfDString(nativeName, -1, &dsTemp);
Tcl_DStringFree(&ds);
/*
@@ -2008,9 +2008,9 @@ TclpCreateTemporaryDirectory(
goto useSystemTemp;
}
Tcl_DStringInit(&base);
- Tcl_UtfToUtf16DString(Tcl_GetString(dirObj), -1, &base);
+ Tcl_UtfToWCharDString(Tcl_GetString(dirObj), -1, &base);
if (dirObj->bytes[dirObj->length - 1] != '\\') {
- Tcl_UtfToUtf16DString("\\", -1, &base);
+ Tcl_UtfToWCharDString("\\", -1, &base);
}
} else {
useSystemTemp:
@@ -2026,11 +2026,11 @@ TclpCreateTemporaryDirectory(
#define SUFFIX_LENGTH 8
if (basenameObj) {
- Tcl_UtfToUtf16DString(Tcl_GetString(basenameObj), -1, &base);
+ Tcl_UtfToWCharDString(Tcl_GetString(basenameObj), -1, &base);
} else {
- Tcl_UtfToUtf16DString(DEFAULT_TEMP_DIR_PREFIX, -1, &base);
+ Tcl_UtfToWCharDString(DEFAULT_TEMP_DIR_PREFIX, -1, &base);
}
- Tcl_UtfToUtf16DString("_", -1, &base);
+ Tcl_UtfToWCharDString("_", -1, &base);
/*
* Now we keep on trying random suffixes until we get one that works
@@ -2057,7 +2057,7 @@ TclpCreateTemporaryDirectory(
tempbuf[i] = randChars[(int) (rand() % numRandChars)];
}
Tcl_DStringSetLength(&base, baseLen);
- Tcl_UtfToUtf16DString(tempbuf, -1, &base);
+ Tcl_UtfToWCharDString(tempbuf, -1, &base);
} while (!CreateDirectoryW((LPCWSTR) Tcl_DStringValue(&base), NULL)
&& (error = GetLastError()) == ERROR_ALREADY_EXISTS);
@@ -2078,7 +2078,7 @@ TclpCreateTemporaryDirectory(
*/
Tcl_DStringInit(&name);
- Tcl_Utf16ToUtfDString((LPCWSTR) Tcl_DStringValue(&base), -1, &name);
+ Tcl_WCharToUtfDString((LPCWSTR) Tcl_DStringValue(&base), -1, &name);
Tcl_DStringFree(&base);
return TclDStringToObj(&name);
}