diff options
author | phantom <phantom@FreeBSD.org> | 2005-02-27 15:11:09 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2005-02-27 15:11:09 +0000 |
commit | 23d961a13f47abb00dde86ee46e2e766a478aca4 (patch) | |
tree | 69f481163c9449c668aa58cf3fa5dbc37df51899 /lib/libc/locale | |
parent | 31651f25d817b24f6d2b1ef090ac6120d90ed86a (diff) | |
download | FreeBSD-src-23d961a13f47abb00dde86ee46e2e766a478aca4.zip FreeBSD-src-23d961a13f47abb00dde86ee46e2e766a478aca4.tar.gz |
. Static'ize functions exported via function reference variables only.
. Replace inclusion of sys/param.h to sys/cdefs.h and sys/types.h where
appropriate.
. move _*_init() prototypes to mblocal.h, and remove these prototypes
from .c files
. use _none_init() in __setrunelocale() instead of duplicating code
. move __mb* variables from table.c to none.c allowing us to not to
export _none_*() externs, and appropriately remove them from mblocal.h
Ok'ed by: tjr
Diffstat (limited to 'lib/libc/locale')
-rw-r--r-- | lib/libc/locale/big5.c | 19 | ||||
-rw-r--r-- | lib/libc/locale/euc.c | 17 | ||||
-rw-r--r-- | lib/libc/locale/gb18030.c | 16 | ||||
-rw-r--r-- | lib/libc/locale/gb2312.c | 16 | ||||
-rw-r--r-- | lib/libc/locale/gbk.c | 19 | ||||
-rw-r--r-- | lib/libc/locale/mblocal.h | 25 | ||||
-rw-r--r-- | lib/libc/locale/mskanji.c | 19 | ||||
-rw-r--r-- | lib/libc/locale/none.c | 44 | ||||
-rw-r--r-- | lib/libc/locale/setrunelocale.c | 16 | ||||
-rw-r--r-- | lib/libc/locale/table.c | 10 | ||||
-rw-r--r-- | lib/libc/locale/utf8.c | 28 |
11 files changed, 112 insertions, 117 deletions
diff --git a/lib/libc/locale/big5.c b/lib/libc/locale/big5.c index dab181d..44b9957 100644 --- a/lib/libc/locale/big5.c +++ b/lib/libc/locale/big5.c @@ -38,9 +38,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)big5.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include <sys/param.h> +#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <sys/types.h> #include <errno.h> #include <runetype.h> #include <stdlib.h> @@ -48,11 +49,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _BIG5_init(_RuneLocale *); -size_t _BIG5_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _BIG5_mbsinit(const mbstate_t *); -size_t _BIG5_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _BIG5_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _BIG5_mbsinit(const mbstate_t *); +static size_t _BIG5_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { wchar_t ch; @@ -70,7 +71,7 @@ _BIG5_init(_RuneLocale *rl) return (0); } -int +static int _BIG5_mbsinit(const mbstate_t *ps) { @@ -85,7 +86,7 @@ _big5_check(u_int c) return ((c >= 0xa1 && c <= 0xfe) ? 2 : 1); } -size_t +static size_t _BIG5_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -146,7 +147,7 @@ _BIG5_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, } } -size_t +static size_t _BIG5_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _BIG5State *bs; diff --git a/lib/libc/locale/euc.c b/lib/libc/locale/euc.c index 9b0b7e5..b3b35ed 100644 --- a/lib/libc/locale/euc.c +++ b/lib/libc/locale/euc.c @@ -49,11 +49,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _EUC_init(_RuneLocale *); -size_t _EUC_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _EUC_mbsinit(const mbstate_t *); -size_t _EUC_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _EUC_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _EUC_mbsinit(const mbstate_t *); +static size_t _EUC_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { int count[4]; @@ -119,7 +119,7 @@ _EUC_init(_RuneLocale *rl) return (0); } -int +static int _EUC_mbsinit(const mbstate_t *ps) { @@ -136,11 +136,12 @@ _EUC_mbsinit(const mbstate_t *ps) static __inline int _euc_set(u_int c) { + c &= 0xff; return ((c & 0x80) ? c == _SS3 ? 3 : c == _SS2 ? 2 : 1 : 0); } -size_t +static size_t _EUC_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -213,7 +214,7 @@ _EUC_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, return (wc == L'\0' ? 0 : s - os); } -size_t +static size_t _EUC_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _EucState *es; diff --git a/lib/libc/locale/gb18030.c b/lib/libc/locale/gb18030.c index 5542f6c..3e43179 100644 --- a/lib/libc/locale/gb18030.c +++ b/lib/libc/locale/gb18030.c @@ -39,11 +39,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _GB18030_init(_RuneLocale *); -size_t _GB18030_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _GB18030_mbsinit(const mbstate_t *); -size_t _GB18030_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _GB18030_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _GB18030_mbsinit(const mbstate_t *); +static size_t _GB18030_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { int count; @@ -63,14 +63,14 @@ _GB18030_init(_RuneLocale *rl) return (0); } -int +static int _GB18030_mbsinit(const mbstate_t *ps) { return (ps == NULL || ((const _GB18030State *)ps)->count == 0); } -size_t +static size_t _GB18030_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -154,7 +154,7 @@ ilseq: return ((size_t)-1); } -size_t +static size_t _GB18030_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _GB18030State *gs; diff --git a/lib/libc/locale/gb2312.c b/lib/libc/locale/gb2312.c index e30755b..232daba 100644 --- a/lib/libc/locale/gb2312.c +++ b/lib/libc/locale/gb2312.c @@ -35,11 +35,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _GB2312_init(_RuneLocale *); -size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _GB2312_mbsinit(const mbstate_t *); -size_t _GB2312_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _GB2312_mbsinit(const mbstate_t *); +static size_t _GB2312_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { int count; @@ -58,7 +58,7 @@ _GB2312_init(_RuneLocale *rl) return (0); } -int +static int _GB2312_mbsinit(const mbstate_t *ps) { @@ -88,7 +88,7 @@ _GB2312_check(const char *str, size_t n) return (1); } -size_t +static size_t _GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -129,7 +129,7 @@ _GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, return (wc == L'\0' ? 0 : len - ocount); } -size_t +static size_t _GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _GB2312State *gs; diff --git a/lib/libc/locale/gbk.c b/lib/libc/locale/gbk.c index 6f377ef..573fd08 100644 --- a/lib/libc/locale/gbk.c +++ b/lib/libc/locale/gbk.c @@ -35,9 +35,10 @@ * SUCH DAMAGE. */ -#include <sys/param.h> +#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <sys/types.h> #include <errno.h> #include <runetype.h> #include <stdlib.h> @@ -45,11 +46,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _GBK_init(_RuneLocale *); -size_t _GBK_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _GBK_mbsinit(const mbstate_t *); -size_t _GBK_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _GBK_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _GBK_mbsinit(const mbstate_t *); +static size_t _GBK_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { wchar_t ch; @@ -67,7 +68,7 @@ _GBK_init(_RuneLocale *rl) return (0); } -int +static int _GBK_mbsinit(const mbstate_t *ps) { @@ -82,7 +83,7 @@ _gbk_check(u_int c) return ((c >= 0x81 && c <= 0xfe) ? 2 : 1); } -size_t +static size_t _GBK_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -143,7 +144,7 @@ _GBK_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, } } -size_t +static size_t _GBK_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _GBKState *gs; diff --git a/lib/libc/locale/mblocal.h b/lib/libc/locale/mblocal.h index 9378c0c..e424ebe 100644 --- a/lib/libc/locale/mblocal.h +++ b/lib/libc/locale/mblocal.h @@ -30,6 +30,18 @@ #define _MBLOCAL_H_ /* + * Rune initialization function prototypes. + */ +int _none_init(_RuneLocale *); +int _UTF8_init(_RuneLocale *); +int _EUC_init(_RuneLocale *); +int _GB18030_init(_RuneLocale *); +int _GB2312_init(_RuneLocale *); +int _GBK_init(_RuneLocale *); +int _BIG5_init(_RuneLocale *); +int _MSKanji_init(_RuneLocale *); + +/* * Conversion function pointers for current encoding. */ extern size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, @@ -41,19 +53,6 @@ extern size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict); extern size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, size_t, size_t, mbstate_t * __restrict); -/* - * Conversion functions for "NONE"/C/POSIX encoding. - */ -extern size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, - size_t, mbstate_t * __restrict); -extern int _none_mbsinit(const mbstate_t *); -extern size_t _none_mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, - size_t, size_t, mbstate_t * __restrict); -extern size_t _none_wcrtomb(char * __restrict, wchar_t, - mbstate_t * __restrict); -extern size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, - size_t, size_t, mbstate_t * __restrict); - extern size_t __mbsnrtowcs_std(wchar_t * __restrict, const char ** __restrict, size_t, size_t, mbstate_t * __restrict); extern size_t __wcsnrtombs_std(char * __restrict, const wchar_t ** __restrict, diff --git a/lib/libc/locale/mskanji.c b/lib/libc/locale/mskanji.c index 5c9a303..aba87e7 100644 --- a/lib/libc/locale/mskanji.c +++ b/lib/libc/locale/mskanji.c @@ -36,9 +36,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mskanji.c 1.0 (Phase One) 5/5/95"; #endif /* LIBC_SCCS and not lint */ -#include <sys/param.h> +#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <sys/types.h> #include <errno.h> #include <runetype.h> #include <stdlib.h> @@ -46,11 +47,11 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _MSKanji_init(_RuneLocale *); -size_t _MSKanji_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _MSKanji_mbsinit(const mbstate_t *); -size_t _MSKanji_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); +static size_t _MSKanji_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _MSKanji_mbsinit(const mbstate_t *); +static size_t _MSKanji_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); typedef struct { wchar_t ch; @@ -68,14 +69,14 @@ _MSKanji_init(_RuneLocale *rl) return (0); } -int +static int _MSKanji_mbsinit(const mbstate_t *ps) { return (ps == NULL || ((const _MSKanjiState *)ps)->ch == 0); } -size_t +static size_t _MSKanji_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -133,7 +134,7 @@ _MSKanji_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, } } -size_t +static size_t _MSKanji_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _MSKanjiState *ms; diff --git a/lib/libc/locale/none.c b/lib/libc/locale/none.c index d964233..06b55b9 100644 --- a/lib/libc/locale/none.c +++ b/lib/libc/locale/none.c @@ -51,16 +51,16 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -int _none_init(_RuneLocale *); -size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _none_mbsinit(const mbstate_t *); -size_t _none_mbsnrtowcs(wchar_t * __restrict dst, - const char ** __restrict src, size_t nms, size_t len, - mbstate_t * __restrict ps __unused); -size_t _none_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); -size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, - size_t, size_t, mbstate_t * __restrict); +static size_t _none_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _none_mbsinit(const mbstate_t *); +static size_t _none_mbsnrtowcs(wchar_t * __restrict dst, + const char ** __restrict src, size_t nms, size_t len, + mbstate_t * __restrict ps __unused); +static size_t _none_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); +static size_t _none_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict); int _none_init(_RuneLocale *rl) @@ -76,7 +76,7 @@ _none_init(_RuneLocale *rl) return(0); } -int +static int _none_mbsinit(const mbstate_t *ps __unused) { @@ -87,7 +87,7 @@ _none_mbsinit(const mbstate_t *ps __unused) return (1); } -size_t +static size_t _none_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps __unused) { @@ -103,7 +103,7 @@ _none_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, return (*s == '\0' ? 0 : 1); } -size_t +static size_t _none_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps __unused) { @@ -119,7 +119,7 @@ _none_wcrtomb(char * __restrict s, wchar_t wc, return (1); } -size_t +static size_t _none_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, mbstate_t * __restrict ps __unused) { @@ -144,7 +144,7 @@ _none_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, return (nchr); } -size_t +static size_t _none_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, size_t len, mbstate_t * __restrict ps __unused) { @@ -177,3 +177,17 @@ _none_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, *src = s; return (nchr); } + +/* setup defaults */ + +int __mb_cur_max = 1; +size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict) = _none_mbrtowc; +int (*__mbsinit)(const mbstate_t *) = _none_mbsinit; +size_t (*__mbsnrtowcs)(wchar_t * __restrict, const char ** __restrict, + size_t, size_t, mbstate_t * __restrict) = _none_mbsnrtowcs; +size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict) = + _none_wcrtomb; +size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict) = _none_wcsnrtombs; + diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index 53699e7..398bfc5 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -49,14 +49,6 @@ __FBSDID("$FreeBSD$"); #include "mblocal.h" #include "setlocale.h" -extern int _none_init(_RuneLocale *); -extern int _UTF8_init(_RuneLocale *); -extern int _EUC_init(_RuneLocale *); -extern int _GB18030_init(_RuneLocale *); -extern int _GB2312_init(_RuneLocale *); -extern int _GBK_init(_RuneLocale *); -extern int _BIG5_init(_RuneLocale *); -extern int _MSKanji_init(_RuneLocale *); extern _RuneLocale *_Read_RuneMagi(FILE *); static int __setrunelocale(const char *); @@ -86,13 +78,7 @@ __setrunelocale(const char *encoding) * The "C" and "POSIX" locale are always here. */ if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) { - _CurrentRuneLocale = &_DefaultRuneLocale; - __mb_cur_max = 1; - __mbrtowc = _none_mbrtowc; - __mbsinit = _none_mbsinit; - __mbsnrtowcs = _none_mbsnrtowcs; - __wcrtomb = _none_wcrtomb; - __wcsnrtombs = _none_wcsnrtombs; + _none_init(&_DefaultRuneLocale); return (0); } diff --git a/lib/libc/locale/table.c b/lib/libc/locale/table.c index f513ceb..7db1b13 100644 --- a/lib/libc/locale/table.c +++ b/lib/libc/locale/table.c @@ -251,13 +251,3 @@ _RuneLocale _DefaultRuneLocale = { _RuneLocale *_CurrentRuneLocale = &_DefaultRuneLocale; -int __mb_cur_max = 1; -size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict) = _none_mbrtowc; -int (*__mbsinit)(const mbstate_t *) = _none_mbsinit; -size_t (*__mbsnrtowcs)(wchar_t * __restrict, const char ** __restrict, - size_t, size_t, mbstate_t * __restrict) = _none_mbsnrtowcs; -size_t (*__wcrtomb)(char * __restrict, wchar_t, mbstate_t * __restrict) = - _none_wcrtomb; -size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict, - size_t, size_t, mbstate_t * __restrict) = _none_wcsnrtombs; diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 2f55ffd..2f537a5 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -35,14 +35,16 @@ __FBSDID("$FreeBSD$"); #include <wchar.h> #include "mblocal.h" -size_t _UTF8_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict); -int _UTF8_mbsinit(const mbstate_t *); -size_t _UTF8_mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, - size_t, size_t, mbstate_t * __restrict); -size_t _UTF8_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); -size_t _UTF8_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, - size_t, size_t, mbstate_t * __restrict); +static size_t _UTF8_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict); +static int _UTF8_mbsinit(const mbstate_t *); +static size_t _UTF8_mbsnrtowcs(wchar_t * __restrict, + const char ** __restrict, size_t, size_t, + mbstate_t * __restrict); +static size_t _UTF8_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict); +static size_t _UTF8_wcsnrtombs(char * __restrict, const wchar_t ** __restrict, + size_t, size_t, mbstate_t * __restrict); typedef struct { wchar_t ch; @@ -65,14 +67,14 @@ _UTF8_init(_RuneLocale *rl) return (0); } -int +static int _UTF8_mbsinit(const mbstate_t *ps) { return (ps == NULL || ((const _UTF8State *)ps)->want == 0); } -size_t +static size_t _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps) { @@ -194,7 +196,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, return (wch == L'\0' ? 0 : want); } -size_t +static size_t _UTF8_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, mbstate_t * __restrict ps) { @@ -276,7 +278,7 @@ _UTF8_mbsnrtowcs(wchar_t * __restrict dst, const char ** __restrict src, return (nchr); } -size_t +static size_t _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) { _UTF8State *us; @@ -344,7 +346,7 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) return (len); } -size_t +static size_t _UTF8_wcsnrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t nwc, size_t len, mbstate_t * __restrict ps) { |