MBSTRING(3X) — Subroutines
NAME
mbstring − multi-byte character string operations: mbslen, mbschr, mbsrchr
SYNOPSIS
#include <codelibs/mbstring.h>
int mbslen(const char ∗str);
/∗ overloaded functions available from C++ only ∗/
char ∗mbschr(char ∗str, wchar_t ch);
char ∗mbsrchr(char ∗str, wchar_t ch);
const char ∗mbschr(const char ∗str, wchar_t ch);
const char ∗mbsrchr(const char ∗str, wchar_t ch);
/∗ functions available from C and ANSI C only ∗/
char ∗mbschr(const char ∗str, wchar_t ch);
char ∗mbsrchr(const char ∗str, wchar_t ch);
CC ... -lcodelibs
DESCRIPTION
These functions operate on null-terminated multi-byte strings. Many of these are extended versions of the routines in string(3C). All of these functions are affected by the current value of the LANG environment variable.
mbslen
Mbslen returns the number of characters, rather than the number of bytes, in str.
mbschr mbsrchr
Mbschr and mbsrchr are the equivalent of the strchr(3C) and strrchr(3C) functions, respectively, except that they search for a wide character in a multi-byte string. Mbschr searches from the beginning of str for the specified wide character, and mbsrchr searches from the end of str for the specified wide character.
WARNINGS
The ANSI C versions of these routines aren’t type-safe with respect to preserving the const attribute of the parameter because it isn’t possible to do this correctly in ANSI C. It is, however, consistent with strchr(3C) and strrchr(3C).
SEE ALSO
NOTES
Supports HP-NLS 8-bit and 16-bit characters.
— codelibs — C++