X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Fwchar.h;h=c3d8b045440a696bfc437b86f83ee182900d2b92;hp=3f325bff27bcf02ba745c1cf97d1ae70882a58b8;hb=1461e027579c16a6bd95a264d9a1db75a4c3fa74;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/include/wchar.h b/include/wchar.h index 3f325bff..c3d8b045 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -10,12 +10,19 @@ extern "C" { #define __NEED_size_t #define __NEED_wchar_t #define __NEED_wint_t + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) #define __NEED_wctype_t +#endif #include #undef NULL +#ifdef __cplusplus +#define NULL 0 +#else #define NULL ((void*)0) +#endif #undef WCHAR_MIN #undef WCHAR_MAX @@ -40,6 +47,7 @@ wchar_t *wcsncat (wchar_t *, const wchar_t *, size_t); int wcscmp (const wchar_t *, const wchar_t *); int wcsncmp (const wchar_t *, const wchar_t *, size_t); +int wcscoll(const wchar_t *, const wchar_t *); size_t wcsxfrm (wchar_t *, const wchar_t *, size_t n); wchar_t *wcschr (const wchar_t *, wchar_t); @@ -74,9 +82,6 @@ size_t mbrlen (const char *, size_t, mbstate_t *); size_t mbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *); size_t wcsrtombs (char *, const wchar_t **, size_t, mbstate_t *); -int wcwidth (wchar_t); -int wcswidth (const wchar_t *, size_t); - float wcstof (const wchar_t *, wchar_t **); double wcstod (const wchar_t *, wchar_t **); long double wcstold (const wchar_t *, wchar_t **); @@ -94,11 +99,11 @@ int fwide (FILE *, int); int wprintf (const wchar_t *, ...); int fwprintf (FILE *, const wchar_t *, ...); -int swprintf (wchar_t *, const wchar_t *, ...); +int swprintf (wchar_t *, size_t, const wchar_t *, ...); int vwprintf (const wchar_t *, va_list); int vfwprintf (FILE *, const wchar_t *, va_list); -int vswprintf (wchar_t *, const wchar_t *, va_list); +int vswprintf (wchar_t *, size_t, const wchar_t *, va_list); int wscanf (const wchar_t *, ...); int fwscanf (FILE *, const wchar_t *, ...); @@ -126,6 +131,16 @@ size_t wcsftime (wchar_t *, size_t, const wchar_t *, const struct tm *); #undef iswdigit +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +FILE *open_wmemstream(wchar_t **, size_t *); +size_t mbsnrtowcs(wchar_t *, const char **, size_t, size_t, mbstate_t *); +size_t wcsnrtombs(char *, const wchar_t **, size_t, size_t, mbstate_t *); +#endif + +#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) +int wcwidth (wchar_t); +int wcswidth (const wchar_t *, size_t); int iswalnum(wint_t); int iswalpha(wint_t); int iswblank(wint_t); @@ -142,8 +157,9 @@ int iswctype(wint_t, wctype_t); wint_t towlower(wint_t); wint_t towupper(wint_t); wctype_t wctype(const char *); - +#undef iswdigit #define iswdigit(a) ((unsigned)(a)-'0' < 10) +#endif #ifdef __cplusplus }