summaryrefslogtreecommitdiff
path: root/libc/misc/wchar/wchar.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/wchar/wchar.c')
-rw-r--r--libc/misc/wchar/wchar.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 28efbba22..62a5af704 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -178,6 +178,7 @@ extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(btowc)
wint_t btowc(int c)
{
#ifdef __CTYPE_HAS_8_BIT_LOCALES
@@ -208,7 +209,6 @@ wint_t btowc(int c)
#endif /* __CTYPE_HAS_8_BIT_LOCALES */
}
-libc_hidden_proto(btowc)
libc_hidden_def(btowc)
#endif
@@ -248,11 +248,11 @@ int wctob(wint_t c)
/**********************************************************************/
#ifdef L_mbsinit
+libc_hidden_proto(mbsinit)
int mbsinit(const mbstate_t *ps)
{
return !ps || !ps->__mask;
}
-libc_hidden_proto(mbsinit)
libc_hidden_def(mbsinit)
#endif
@@ -261,13 +261,13 @@ libc_hidden_def(mbsinit)
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(mbrlen)
size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
{
static mbstate_t mbstate; /* Rely on bss 0-init. */
return mbrtowc(NULL, s, n, (ps != NULL) ? ps : &mbstate);
}
-libc_hidden_proto(mbrlen)
libc_hidden_def(mbrlen)
#endif
@@ -276,6 +276,7 @@ libc_hidden_def(mbrlen)
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbrtowc)
size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
size_t n, mbstate_t *__restrict ps)
{
@@ -326,7 +327,6 @@ size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
}
return (size_t) r;
}
-libc_hidden_proto(mbrtowc)
libc_hidden_def(mbrtowc)
#endif
@@ -338,6 +338,7 @@ libc_hidden_proto(wcsnrtombs)
/* Note: We completely ignore ps in all currently supported conversions. */
/* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcrtomb)
size_t wcrtomb(register char *__restrict s, wchar_t wc,
mbstate_t *__restrict ps)
{
@@ -360,7 +361,6 @@ size_t wcrtomb(register char *__restrict s, wchar_t wc,
r = wcsnrtombs(s, &pwc, 1, MB_LEN_MAX, ps);
return (r != 0) ? r : 1;
}
-libc_hidden_proto(wcrtomb)
libc_hidden_def(wcrtomb)
#endif
@@ -369,6 +369,7 @@ libc_hidden_def(wcrtomb)
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbsrtowcs)
size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
@@ -377,7 +378,6 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
return mbsnrtowcs(dst, src, SIZE_MAX, len,
((ps != NULL) ? ps : &mbstate));
}
-libc_hidden_proto(mbsrtowcs)
libc_hidden_def(mbsrtowcs)
#endif
@@ -390,12 +390,12 @@ libc_hidden_def(mbsrtowcs)
libc_hidden_proto(wcsnrtombs)
+libc_hidden_proto(wcsrtombs)
size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
return wcsnrtombs(dst, src, SIZE_MAX, len, ps);
}
-libc_hidden_proto(wcsrtombs)
libc_hidden_def(wcsrtombs)
#endif
@@ -694,6 +694,7 @@ size_t attribute_hidden _wchar_wcsntoutf8s(char *__restrict s, size_t n,
/* WARNING: We treat len as SIZE_MAX when dst is NULL! */
+libc_hidden_proto(mbsnrtowcs)
size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t NMC, size_t len, mbstate_t *__restrict ps)
{
@@ -792,7 +793,6 @@ size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
}
return len - count;
}
-libc_hidden_proto(mbsnrtowcs)
libc_hidden_def(mbsnrtowcs)
#endif
@@ -804,6 +804,7 @@ libc_hidden_def(mbsnrtowcs)
/* Note: We completely ignore ps in all currently supported conversions.
* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcsnrtombs)
size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t NWC, size_t len, mbstate_t *__restrict ps)
{
@@ -912,13 +913,14 @@ size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
}
return len - count;
}
-libc_hidden_proto(wcsnrtombs)
libc_hidden_def(wcsnrtombs)
#endif
/**********************************************************************/
#ifdef L_wcswidth
+libc_hidden_proto(wcswidth)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: If we start doing translit, wcwidth and wcswidth will need updating.
#warning TODO: Update wcwidth to match latest by Kuhn.
@@ -1155,7 +1157,6 @@ int wcswidth(const wchar_t *pwcs, size_t n)
#endif /* __UCLIBC_HAS_LOCALE__ */
-libc_hidden_proto(wcswidth)
libc_hidden_def(wcswidth)
#endif