mbrlen()
QNX SDP8.0C Library ReferenceAPIDeveloper
Count the bytes in a multibyte character (restartable)
Synopsis:
#include <wchar.h>
size_t mbrlen( const char * s,
size_t n,
mbstate_t * ps);
Arguments:
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The mbrlen() function counts the bytes in the multibyte character pointed to by s, to a maximum of n bytes.
Returns:
- (size_t)-2
- The resulting conversion state indicates an incomplete multibyte character after all n characters were converted.
- (size_t)-1
- The function detected an encoding error before completing the next multibyte character, in which case the function sets errno to EILSEQ and leaves the resulting conversion state undefined.
- 0
- The next completed character is a null character, in which case the resulting conversion state is the initial conversion state.
- x
- The number of bytes needed to complete the next multibyte character, in which case the resulting conversion state indicates that x bytes have been converted.
Errors:
- EILSEQ
- Invalid character sequence.
- EINVAL
- The ps argument points to an invalid object.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Read the Caveats |
Caveats:
This function is safe to call in a multithreaded program if the ps argument isn't NULL.
Page updated: