summaryrefslogtreecommitdiff
path: root/base/gp_winfs.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2022-11-21 16:35:17 +0000
committerRobin Watts <Robin.Watts@artifex.com>2022-11-21 18:58:51 +0000
commite15f8ff9db30c4e780973cef79e162baed6047c6 (patch)
treed73af5935cceb56721479331fdd2a901b7b083c7 /base/gp_winfs.c
parent31f96d10d419ca83c6d9bcafb2c635df35bb537c (diff)
downloadghostpdl-e15f8ff9db30c4e780973cef79e162baed6047c6.tar.gz
Move gp_wutf8 functions to be gp_utf8.
Promote previously windows specific functions to be generically available (and give them names that reflect that).
Diffstat (limited to 'base/gp_winfs.c')
-rw-r--r--base/gp_winfs.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/base/gp_winfs.c b/base/gp_winfs.c
index 39795a19c..173533dc2 100644
--- a/base/gp_winfs.c
+++ b/base/gp_winfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,7 +32,7 @@ extern intptr_t _get_osfhandle(int fd);
FILE *
gp_fopen_impl(gs_memory_t *mem, const char *fname, const char *mode)
{
- int len = utf8_to_wchar(NULL, fname);
+ int len = gp_utf8_to_uint16(NULL, fname);
wchar_t *uni;
wchar_t wmode[4];
FILE *file;
@@ -43,8 +43,8 @@ gp_fopen_impl(gs_memory_t *mem, const char *fname, const char *mode)
uni = (wchar_t *)gs_alloc_bytes(mem, len*sizeof(wchar_t), "gp_fopen_impl");
if (uni == NULL)
return NULL;
- utf8_to_wchar(uni, fname);
- utf8_to_wchar(wmode, mode);
+ gp_utf8_to_uint16(uni, fname);
+ gp_utf8_to_uint16(wmode, mode);
file = _wfopen(uni, wmode);
gs_free_object(mem, uni, "gs_fopen_impl");
@@ -54,7 +54,7 @@ gp_fopen_impl(gs_memory_t *mem, const char *fname, const char *mode)
int
gp_unlink_impl(gs_memory_t *mem, const char *fname)
{
- int len = utf8_to_wchar(NULL, fname);
+ int len = gp_utf8_to_uint16(NULL, fname);
wchar_t *uni;
int ret;
@@ -64,7 +64,7 @@ gp_unlink_impl(gs_memory_t *mem, const char *fname)
uni = (wchar_t *)gs_alloc_bytes(mem, len*sizeof(wchar_t), "gp_unlink_impl");
if (uni == NULL)
return gs_error_VMerror;
- utf8_to_wchar(uni, fname);
+ gp_utf8_to_uint16(uni, fname);
ret = _wunlink(uni);
gs_free_object(mem, uni, "gs_unlink_impl");
@@ -74,8 +74,8 @@ gp_unlink_impl(gs_memory_t *mem, const char *fname)
int
gp_rename_impl(gs_memory_t *mem, const char *from, const char *to)
{
- int lenf = utf8_to_wchar(NULL, from);
- int lent = utf8_to_wchar(NULL, to);
+ int lenf = gp_utf8_to_uint16(NULL, from);
+ int lent = gp_utf8_to_uint16(NULL, to);
wchar_t *unif, *unit;
int ret;
@@ -90,8 +90,8 @@ gp_rename_impl(gs_memory_t *mem, const char *from, const char *to)
gs_free_object(mem, unif, "gs_unlink_impl");
return gs_error_VMerror;
}
- utf8_to_wchar(unif, from);
- utf8_to_wchar(unit, to);
+ gp_utf8_to_uint16(unif, from);
+ gp_utf8_to_uint16(unit, to);
ret = _wrename(unif, unit);
gs_free_object(mem, unif, "gs_rename_impl");
gs_free_object(mem, unit, "gs_rename_impl");