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/mbrlen.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/mbrlen.3')
-rw-r--r-- | lib/libc/locale/mbrlen.3 | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/libc/locale/mbrlen.3 b/lib/libc/locale/mbrlen.3 index 51548a4..cbdd13e 100644 --- a/lib/libc/locale/mbrlen.3 +++ b/lib/libc/locale/mbrlen.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 November 11, 2002 +.Dd April 7, 2004 .Dt MBRLEN 3 .Os .Sh NAME @@ -39,12 +39,12 @@ .Sh DESCRIPTION The .Fn mbrlen -function determines the number of bytes constituting the -multibyte character sequence pointed to by -.Fa s , -examining at most +function inspects at most .Fa n -bytes. +bytes pointed to by +.Fa s +to determine the number of bytes needed to complete the next +multibyte character. .Pp The .Vt mbstate_t @@ -56,7 +56,8 @@ If it is .Fn mbrlen uses an internal, static .Vt mbstate_t -object. +object, which is initialized to the initial conversion state +at program startup. .Pp It is equivalent to: .Pp @@ -77,33 +78,33 @@ The 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. +.Fn mbrlen +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 EXAMPLES -A function which calculates the number of characters in a multibyte +A function that calculates the number of characters in a multibyte character string: .Bd -literal -offset indent size_t @@ -128,18 +129,17 @@ The .Fn mbrlen 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 mblen 3 , -.Xr mbrtowc 3 +.Xr mbrtowc 3 , +.Xr multibyte 3 .Sh STANDARDS The .Fn mbrlen function conforms to .St -isoC-99 . -.Sh BUGS -The current implementation does not support shift states. |