From 62755474e58f3238fb1c672dcbcf91182481c23f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 7 Apr 2009 12:13:37 +0000 Subject: * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb, and con_charset. (dev_console::str_to_con): Take mbtowc function pointer and charset as additional parameters. * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize aforementioned new members. Explain why. (dev_console::con_to_str): Remove useless comment. Call new sys_cp_wcstombs function rather than sys_wcstombs. (dev_console::str_to_con): Take mbtowc function pointer and charset as additional parameters. Call sys_cp_mbstowcs accordingly. (fhandler_console::write_normal): Only initialize f_mbtowc and charset once. Accommodate changed str_to_con. * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take wctomb function pointer and charset as parameters. Use throughout. (sys_cp_mbstowcs): Take wctomb function pointer and charset as parameters instead of codepage. Remove matching local variables and their initialization. * wchar.h (ENCODING_LEN): Define as in newlib. (__mbtowc): Use mbtowc_p typedef for declaration. (wctomb_f): New type. (wctomb_p): New type. (__wctomb): Declare. (__utf8_wctomb): Use wctomb_f typedef for declaration. (sys_cp_wcstombs): Move declaration from winsup.h here. (sys_wcstombs): Ditto. (sys_wcstombs_alloc): Ditto. (sys_cp_mbstowcs): Ditto. (sys_mbstowcs): Ditto. (sys_mbstowcs_alloc): Ditto. * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include wchar.h instead. --- winsup/cygwin/winsup.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'winsup/cygwin/winsup.h') diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 44f7caa37..5ba9d0c8c 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -108,22 +108,6 @@ extern "C" DWORD WINAPI GetLastError (void); description see there. */ #define HEAP_NOTHEAP -1 -size_t __stdcall sys_wcstombs (char *, size_t, const PWCHAR, size_t = (size_t) -1) - __attribute__ ((regparm(3))); -size_t __stdcall sys_wcstombs_alloc (char **, int, const PWCHAR, size_t = (size_t) -1) - __attribute__ ((regparm(3))); - -size_t __stdcall sys_cp_mbstowcs (UINT, PWCHAR, size_t, const char *, size_t = (size_t) -1) - __attribute__ ((regparm(3))); -inline size_t -sys_mbstowcs (PWCHAR dst, size_t dlen, const char *src, - size_t nms = (size_t) -1) -{ - return sys_cp_mbstowcs (0, dst, dlen, src, nms); -} -size_t __stdcall sys_mbstowcs_alloc (PWCHAR *, int, const char *, size_t = (size_t) -1) - __attribute__ ((regparm(3))); - /* Used to check if Cygwin DLL is dynamically loaded. */ extern int cygserver_running; @@ -134,6 +118,8 @@ extern int cygserver_running; #include "debug.h" +#include + /**************************** Convenience ******************************/ /* Used to define status flag accessor methods */ -- cgit v1.2.3