diff options
author | tjr <tjr@FreeBSD.org> | 2004-04-08 09:59:02 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-04-08 09:59:02 +0000 |
commit | 0ca2900d48dfa7dae63123b1d83e6cd98836161d (patch) | |
tree | c6fc48691135e1db58250e02c80d82de9f2582ad /lib/libc/locale/mbrtowc.3 | |
parent | d35a5d60b9bfab2480aec8538a44fa0672fffdc8 (diff) | |
download | FreeBSD-src-0ca2900d48dfa7dae63123b1d83e6cd98836161d.zip FreeBSD-src-0ca2900d48dfa7dae63123b1d83e6cd98836161d.tar.gz |
Update manual pages for change to C99 mbrtowc() semantics.
Diffstat (limited to 'lib/libc/locale/mbrtowc.3')
-rw-r--r-- | lib/libc/locale/mbrtowc.3 | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/lib/libc/locale/mbrtowc.3 b/lib/libc/locale/mbrtowc.3 index b986db2..d0a13cb 100644 --- a/lib/libc/locale/mbrtowc.3 +++ b/lib/libc/locale/mbrtowc.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2002 Tim J. Robbins +.\" Copyright (c) 2002-2004 Tim J. Robbins .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2002 +.Dd April 8, 2004 .Dt MBRTOWC 3 .Os .Sh NAME @@ -46,16 +46,15 @@ function inspects at most .Fa n bytes pointed to by .Fa s -and interprets them as a multibyte character sequence -according to the current setting of -.Ev LC_CTYPE . -If +to determine the number of bytes needed to complete the next multibyte +character. +If a character can be completed, and .Fa pwc is not .Dv NULL , -the multibyte character which +the wide character which is represented by .Fa s -represents is stored in the +is stored in the .Vt wchar_t it points to. .Pp @@ -85,50 +84,52 @@ If it is .Fn mbrtowc uses an internal, static .Vt mbstate_t -object. +object, which is initialized to the initial conversion state +at program startup. .Sh RETURN VALUES The .Fn mbrtowc functions returns: .Bl -tag -width indent .It 0 -The first +The next .Fa n -or fewer bytes of -.Fa s +or fewer bytes represent the null wide character .Pq Li "L'\e0'" . .It >0 -The first +The next .Fa n -or fewer bytes of -.Fa s +or fewer bytes represent a valid character, .Fn mbrtowc -returns the length (in bytes) of the multibyte sequence. +returns the number of bytes used to complete the multibyte character. .It Po Vt size_t Pc Ns \-2 -The first +The next .Fa n -bytes of -.Fa s -are an incomplete multibyte sequence. +contribute to, but do not complete, a valid multibyte character sequence, +and all +.Fa n +bytes have been processed. .It Po Vt size_t Pc Ns \-1 -The byte sequence pointed to by -.Fa s -is an invalid multibyte sequence. +An encoding error has occurred. +The next +.Fa fn +or fewer bytes do not contribute to a valid multibyte character. .El .Sh ERRORS The .Fn mbrtowc function will fail if: .Bl -tag -width Er -.\".It Bq Er EINVAL -.\"Invalid argument. .It Bq Er EILSEQ An invalid multibyte sequence was detected. +.It Bq Er EINVAL +The conversion state is invalid. .El .Sh SEE ALSO .Xr mbtowc 3 , +.Xr multibyte 3 , .Xr setlocale 3 , .Xr wcrtomb 3 .Sh STANDARDS @@ -136,5 +137,3 @@ The .Fn mbrtowc function conforms to .St -isoC-99 . -.Sh BUGS -The current implementation does not support shift states. |