From a68c1975bda47b0698b48761a62e95b371095e9a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 21 Aug 2020 21:11:21 +0200 Subject: core,w32: Add UTF-8 support to gpgrt_fopen, gpgrt_mkdir and gpgrt_chdir. * src/protos.h: New. * src/Makefile.am (libgpg_error_la_SOURCES): Add file. * src/gpgrt-int.h: Include protos.h. * src/sysutils.c (_gpgrt_mkdir) [W32]: Make UTF-8 aware. (_gpgrt_chdir) [W32]: Ditto. * src/w32-gettext.c: Include protos.h. (utf8_to_wchar): Allow for strings. (_gpgrt_utf8_to_wchar): New. (_gpgrt_free_wchar): New. * src/estream.c (map_w32_to_errno): Add more error codes. (_gpgrt_w32_set_errno): New. (any8bitchar) [W32]: New helper. (func_file_create) [W32]: Convert file name and use _wopen. -- GnuPG-bug-id: 4083 Signed-off-by: Werner Koch --- src/protos.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/protos.h (limited to 'src/protos.h') diff --git a/src/protos.h b/src/protos.h new file mode 100644 index 0000000..9a8d57a --- /dev/null +++ b/src/protos.h @@ -0,0 +1,30 @@ +/* protos.h - Miscellaneous prototypes + * Copyright (C) 2020 g10 Code GmbH + * + * This file is part of libgpg-error. + * + * libgpg-error is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * libgpg-error is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + * SPDX-License-Identifier: LGPL-2.1+ + */ + +#ifndef _GPGRT_PROTOS_H +#define _GPGRT_PROTOS_H + +/*-- w32-gettext.c --*/ +wchar_t *_gpgrt_utf8_to_wchar (const char *string); +void _gpgrt_free_wchar (wchar_t *wstring); +void _gpgrt_w32_set_errno (int ec); + + +#endif /*_GPGRT_PROTOS_H*/ -- cgit v1.2.3