diff options
Diffstat (limited to 'man3/mblen.3')
| -rw-r--r-- | man3/mblen.3 | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/man3/mblen.3 b/man3/mblen.3 index 5f592f1278..1c8e1e5027 100644 --- a/man3/mblen.3 +++ b/man3/mblen.3 @@ -21,7 +21,9 @@ mblen \- determine number of bytes in next multibyte character .BI "int mblen(const char *" s ", size_t " n ); .fi .SH DESCRIPTION -If \fIs\fP is not a NULL pointer, the \fBmblen\fP() function inspects at most +If \fIs\fP is not a NULL pointer, the +.BR mblen () +function inspects at most \fIn\fP bytes of the multibyte string starting at \fIs\fP and extracts the next complete multibyte character. It uses a static anonymous shift state only @@ -31,23 +33,30 @@ character, it returns the number of bytes that were consumed from \fIs\fP. If the multibyte character is the null wide character, it returns 0. .PP If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte -character, \fBmblen\fP() returns \-1. +character, +.BR mblen () +returns \-1. This can happen even if \fIn\fP >= \fIMB_CUR_MAX\fP, if the multibyte string contains redundant shift sequences. .PP If the multibyte string starting at \fIs\fP contains an invalid multibyte -sequence before the next complete character, \fBmblen\fP() +sequence before the next complete character, +.BR mblen () also returns \-1. .PP -If \fIs\fP is a NULL pointer, the \fBmblen\fP() function +If \fIs\fP is a NULL pointer, the +.BR mblen () +function .\" The Dinkumware doc and the Single Unix specification say this, but .\" glibc doesn't implement this. resets the shift state, only known to this function, to the initial state, and returns non-zero if the encoding has non-trivial shift state, or zero if the encoding is stateless. .SH "RETURN VALUE" -The \fBmblen\fP() function returns the number of +The +.BR mblen () +function returns the number of bytes parsed from the multibyte sequence starting at \fIs\fP, if a non-null wide character was recognized. It returns 0, if a null wide character was recognized. @@ -59,8 +68,12 @@ C99 .SH "SEE ALSO" .BR mbrlen (3) .SH NOTES -The behaviour of \fBmblen\fP() depends on the LC_CTYPE category of the +The behaviour of +.BR mblen () +depends on the LC_CTYPE category of the current locale. .PP -The function \fBmbrlen\fP(3) provides a better interface to the same +The function +.BR mbrlen (3) +provides a better interface to the same functionality. |
