]> git.saurik.com Git - apple/libc.git/blobdiff - locale/FreeBSD/wctomb.3
Libc-1244.1.7.tar.gz
[apple/libc.git] / locale / FreeBSD / wctomb.3
index b7de6e5428a237bd56c93e68873f1d614de7e95e..33f6e37798adf7963c3e96618d2bba7f7cfcd6d8 100644 (file)
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by the University of
-.\"    California, Berkeley and its contributors.
 .\" 4. Neither the name of the University nor the names of its contributors
 .\"    may be used to endorse or promote products derived from this software
 .\"    without specific prior written permission.
 .\"
 .\" From @(#)multibyte.3       8.1 (Berkeley) 6/4/93
 .\" From FreeBSD: src/lib/libc/locale/multibyte.3,v 1.22 2003/11/08 03:23:11 tjr Exp
-.\" $FreeBSD: src/lib/libc/locale/wctomb.3,v 1.3 2004/07/05 06:36:36 ru Exp $
+.\" $FreeBSD: src/lib/libc/locale/wctomb.3,v 1.4 2007/01/09 00:28:01 imp Exp $
 .\"
 .Dd April 8, 2004
 .Dt WCTOMB 3
 .Os
 .Sh NAME
-.Nm wctomb
+.Nm wctomb ,
+.Nm wctomb_l
 .Nd convert a wide-character code to a character
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In stdlib.h
 .Ft int
-.Fn wctomb "char *mbchar" "wchar_t wchar"
+.Fo wctomb
+.Fa "char *s"
+.Fa "wchar_t wchar"
+.Fc
+.In stdlib.h
+.In xlocale.h
+.Ft int
+.Fo wctomb_l
+.Fa "char *s"
+.Fa "wchar_t wchar"
+.Fa "locale_t loc"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn wctomb
-function converts a wide character
-.Fa wchar
-into a multibyte character and stores
-the result in
-.Fa mbchar .
+function converts a wide character,
+.Fa wchar ,
+into a multibyte character and stores the result in
+.Fa s .
 The object pointed to by
-.Fa mbchar
-must be large enough to accommodate the multibyte character, which
-may be up to
+.Fa s
+must be large enough to accommodate the multibyte character,
+which may be up to
 .Dv MB_LEN_MAX
 bytes.
 .Pp
 A call with a null
-.Fa mbchar
+.Fa s
 pointer returns nonzero if the current locale requires shift states,
 zero otherwise;
 if shift states are required, the shift state is reset to the initial state.
+.Pp
+Although the
+.Fn wctomb
+function uses the current locale, the
+.Fn wctomb_l
+function may be passed a locale directly. See
+.Xr xlocale 3
+for more information.
 .Sh RETURN VALUES
 If
-.Fa mbchar
+.Fa s
 is
 .Dv NULL ,
 the
@@ -79,12 +94,12 @@ the
 function returns nonzero if shift states are supported,
 zero otherwise.
 If
-.Fa mbchar
+.Fa s
 is valid,
 .Fn wctomb
 returns
 the number of bytes processed in
-.Fa mbchar ,
+.Fa s ,
 or \-1 if no multibyte character
 could be recognized or converted.
 In this case,
@@ -104,7 +119,8 @@ The internal conversion state is invalid.
 .Xr mbtowc 3 ,
 .Xr wcrtomb 3 ,
 .Xr wcstombs 3 ,
-.Xr wctob 3
+.Xr wctob 3 ,
+.Xr xlocale 3
 .Sh STANDARDS
 The
 .Fn wctomb