| manpages.info - online man pages | ![]() |
|||
|
mbrlen (3) Table of Contents
Namembrlen - get number of bytes in a character (restartable)
LibraryStandard C Library (libc, -lc)
Synopsis#include <wchar.h>
size_t
DescriptionThe mbrlen() function determines the number of bytes constituting the multibyte character sequence pointed to by s, examining at most n bytes.
The mbstate_t argument, ps, is used to keep track of the shift state. If it is NULL, mbrlen() uses an internal, static mbstate_t object.
It is equivalent to:
mbrtowc(NULL, s, n, ps);
Except that when ps is a NULL pointer, mbrlen() uses its own static, internal mbstate_t object to keep track of the shift state.
Return ValuesThe mbrlen() functions returns:
(size_t)-2
(size_t)-1
ExamplesA function which calculates the number of characters in a multibyte character string:
size_t
chars = 0;
return (chars);
ErrorsThe mbrlen() function will fail if:
See Also
StandardsThe mbrlen() function conforms to ISO/IEC 9899:1999 (``ISO C99'').
BugsThe current implementation does not support shift states.
|