diff options
Diffstat (limited to 'usr/src/man')
-rw-r--r-- | usr/src/man/man3c/Makefile | 10 | ||||
-rw-r--r-- | usr/src/man/man3c/mbstowcs.3c | 115 | ||||
-rw-r--r-- | usr/src/man/man3c/wcstombs.3c | 116 |
3 files changed, 238 insertions, 3 deletions
diff --git a/usr/src/man/man3c/Makefile b/usr/src/man/man3c/Makefile index 61591de7e7..64e8b512cc 100644 --- a/usr/src/man/man3c/Makefile +++ b/usr/src/man/man3c/Makefile @@ -234,6 +234,7 @@ MANFILES= __fbufsize.3c \ mbrtowc.3c \ mbsinit.3c \ mbsrtowcs.3c \ + mbstowcs.3c \ mbtowc.3c \ membar_ops.3c \ memory.3c \ @@ -536,6 +537,7 @@ MANFILES= __fbufsize.3c \ wcstod.3c \ wcstoimax.3c \ wcstol.3c \ + wcstombs.3c \ wcstoul.3c \ wcstring.3c \ wcswidth.3c \ @@ -969,7 +971,6 @@ MANLINKS= FD_CLR.3c \ mbsnrtowcs.3c \ mbsnrtowcs_l.3c \ mbsrtowcs_l.3c \ - mbstowcs.3c \ mbstowcs_l.3c \ mbtowc_l.3c \ memalign.3c \ @@ -1359,6 +1360,7 @@ MANLINKS= FD_CLR.3c \ wcstok.3c \ wcstold.3c \ wcstoll.3c \ + wcstombs_l.3c \ wcstoull.3c \ wcstoumax.3c \ wcswcs.3c \ @@ -1936,8 +1938,8 @@ mbsinit_l.3c := LINKSRC = mbsinit.3c mbsnrtowcs.3c := LINKSRC = mbsrtowcs.3c mbsnrtowcs_l.3c := LINKSRC = mbsrtowcs.3c mbsrtowcs_l.3c := LINKSRC = mbsrtowcs.3c -mbstowcs.3c := LINKSRC = mbsrtowcs.3c -mbstowcs_l.3c := LINKSRC = mbsrtowcs.3c + +mbstowcs_l.3c := LINKSRC = mbstowcs.3c mbtowc_l.3c := LINKSRC = mbtowc.3c @@ -2443,6 +2445,8 @@ watoll.3c := LINKSRC = wcstol.3c wcstoll.3c := LINKSRC = wcstol.3c wstol.3c := LINKSRC = wcstol.3c +wcstombs_l.3c := LINKSRC = wcstombs.3c + wcstoull.3c := LINKSRC = wcstoul.3c wcscat.3c := LINKSRC = wcstring.3c diff --git a/usr/src/man/man3c/mbstowcs.3c b/usr/src/man/man3c/mbstowcs.3c new file mode 100644 index 0000000000..ce2e017050 --- /dev/null +++ b/usr/src/man/man3c/mbstowcs.3c @@ -0,0 +1,115 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2017 Nexenta Systems, Inc. +.\" +.Dd March 28, 2017 +.Dt MBSTOWCS 3C +.Os +.Sh NAME +.Nm mbstowcs , +.Nm mbstowcs_l +.Nd convert a multibyte character string to a wide-character string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft size_t +.Fo mbstowcs +.Fa "wchar_t *restrict pwcs" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft size_t +.Fo mbstowcs_l +.Fa "wchar_t *restrict pwcs" +.Fa "const char *restrict s" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn mbstowcs +function converts a multibyte character string +.Fa s +beginning in the initial conversion state into a wide-character string. +If +.Fa pwcs +is not +.Dv NULL , +the converted characters are stored into array pointed to by +.Fa pwcs . +.Pp +Conversion continues up to and including a terminating null character, which is +also stored, or until +.Fa n +wide-characters have been stored into the array pointed to by +.Fa pwcs . +.Pp +The behavior of +.Fn mbstowcs +function is affected by the +.Ev LC_CTYPE +category of the current locale. +.Pp +The +.Fn mbstowcs_l +function behaves identically to +.Fn mbstowcs , +except instead of using the current locale, it uses the locale as specified by +.Fa loc . +.Sh RETURN VALUES +The +.Fn mbstowcs +and +.Fn mbstowcs_l +functions return the number of wide-characters successfully converted, not +including the terminating null +.Pq if any , +or +.Li \-1 +if conversion encounters a sequence of bytes that does not form a valid +character. +.Sh ERRORS +The +.Fn mbstowcs +and +.Fn mbstowcs_l +functions will fail if: +.Bl -tag -width Er +.It Er EILSEQ +An invalid multibyte sequence was detected. +.It Er EINVAL +The conversion state is invalid. +.El +.Sh INTERFACE STABILITY +The +.Fn mbstowcs +function is +.Sy Standard . +The +.Fn mbstowcs_l +function is +.Sy Uncommited . +.Sh MT-LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr mbsnrtowcs 3C , +.Xr mbtowc 3C , +.Xr newlocale 3C , +.Xr setlocale 3C , +.Xr uselocale 3C , +.Xr wcstombs 3C , +.Xr attributes 5 , +.Xr environ 5 , +.Xr standards 5 diff --git a/usr/src/man/man3c/wcstombs.3c b/usr/src/man/man3c/wcstombs.3c new file mode 100644 index 0000000000..b068bc0c8e --- /dev/null +++ b/usr/src/man/man3c/wcstombs.3c @@ -0,0 +1,116 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2017 Nexenta Systems, Inc. +.\" +.Dd March 28, 2017 +.Dt WCSTOMBS 3C +.Os +.Sh NAME +.Nm wcstombs , +.Nm wcstombs_l +.Nd convert a wide-character string to a multibyte character string +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft size_t +.Fo wcstombs +.Fa "char *restrict s" +.Fa "const wchar_t *restrict pwcs" +.Fa "size_t n" +.Fc +.In stdlib.h +.In xlocale.h +.Ft size_t +.Fo wcstombs_l +.Fa "char *restrict s" +.Fa "const wchar_t *restrict pwcs" +.Fa "size_t n" +.Fa "locale_t loc" +.Fc +.Sh DESCRIPTION +The +.Fn wcstombs +function converts a wide-character string +.Fa pwcs +into a multibyte character string, beginning in the initial conversion state. +If +.Fa s +is not +.Dv NULL , +converted characters are stored into the array pointed to by +.Fa s . +.Pp +Conversion continues up to and including a terminating null wide-character, +which is also stored, or until +.Fa n +bytes have been stored into the array pointed to by +.Fa s . +If the latter case results in partial multibyte character at the end of the +string, it is not stored. +.Pp +The behavior of +.Fn wcstombs +function is affected by the +.Ev LC_CTYPE +category of the current locale. +.Pp +The +.Fn wcstombs_l +function behaves identically to +.Fn wcstombs , +except instead of using the current locale, it uses the locale as specified by +.Fa loc . +.Sh RETURN VALUES +The +.Fn wcstombs +and +.Fn wcstombs_l +functions return the number of bytes in the resulting character sequence, not +including the terminating null +.Pq if any , +or +.Li \-1 +if a code is reached that does not correspond to a valid character. +.Sh ERRORS +The +.Fn wcstombs +and +.Fn wcstombs_l +functions will fail if: +.Bl -tag -width Er +.It Er EILSEQ +A wide-character code does not correspond to a valid character. +.It Er EINVAL +The conversion state is invalid. +.El +.Sh INTERFACE STABILITY +The +.Fn wcstombs +function is +.Sy Standard . +The +.Fn wcstombs_l +function is +.Sy Uncommited . +.Sh MT-LEVEL +.Sy MT-Safe +.Sh SEE ALSO +.Xr mbstowcs 3C , +.Xr newlocale 3C , +.Xr setlocale 3C , +.Xr uselocale 3C , +.Xr wcsnrtombs 3C , +.Xr wctomb 3C , +.Xr attributes 5 , +.Xr environ 5 , +.Xr standards 5 |