MBSTRING(3,L) AIX Technical Reference MBSTRING(3,L)
-------------------------------------------------------------------------------
mbstring
PURPOSE
Performs operations on strings.
SYNTAX
#include <string.h>
#include <mbcs.h>
char *mbscat (s1, s2) char *mbspbrk (s1, s2)
char *s1, s2; const char *s1, *s2;
char *mbscpy (s1, s2) size_t mbsspn (s1, s2)
char *s1, s2; const char *s1, *s2;
size_t mbslen (s) size_t mbscspn (s1, s2)
char *s; const char *s1, *s2;
char *mbsncat (s1, s2, nchar) char *mbstok (s1, s2)
char *s1, *s2; char *s1;
size_t nchar; const char *s2;
char *mbsncpy (s1, s2, nchar) int mbscmp (s1, s2)
char *s1, *s2; char *s1, *s2;
size_t nchar;
int mbsncmp (s1, s2, nchar)
char *mbschr (s, c) char *s1, s2;
char *s; size_t nchar;
mbchar_t c;
char *mbsadvance (sn)
char *mbsrchr (s, c) size_t n;
const char *s;
mbchar_t c;
char *mbsinvalid (s)
const char *s;
#include <stdlib.h>
int mblen (s, n)
const char *s;
size_t n;
Processed November 7, 1990 MBSTRING(3,L) 1
MBSTRING(3,L) AIX Technical Reference MBSTRING(3,L)
#include <stdlib.h>
int mbdwidth (mbs)
char *mbs;
DESCRIPTION
The mbsncat subroutines appends nchar multibyte characters of one string s2 to
another string, s1. This subroutine does not guarantee that the s1 buffer will
not overflow.
Similarly, the mbsncpy subroutine copies nchar multibyte characters.
The mbschr subroutine returns a pointer to the first occurrence of the
multibyte character c in the string s. A NULL pointer is returned if c does
not occur in the string.
The mbsrchr subroutine returns a pointer to the last occurrence of the
multibyte character specified by c in the string s. A NULL pointer is returned
if c does not occur in the string, or if c is an invalid character or NULL. A
NULL is also returned if s is an invalid character.
The mbspbrk subroutine returns a pointer to the first occurrence in the string
pointed to by the s1 parameter of any character from the string pointed to by
the s2 parameter. A NULL pointer is returned is returned if no multibyte
character matches.
The mbslen subroutine returns the number of multibyte characters in the string
pointed to by s.
The mbsspn subroutine returns the length in bytes of the initial segment of the
string pointed to by the s1 parameter, consisting entirely of characters from
the string pointed to by the s2 parameter.
The mbscspn subroutine returns the length in bytes of the initial segment of
the string pointed to by the s1 parameter, consisting entirely of characters
NOT from the string pointed to by the s2 parameter.
The mbstok subroutine returns a pointer to an occurrence of a text token in the
string pointed to by the s1 parameter. The s2 parameter specifies a set of
token delimiters. At the found character in s1, a null character is replaced
and a pointer to the first character of the text token is returned.
The mbscmp subroutine compares multibyte characters in one string s1 and the
another string s2. The comparison is based on the binary ordering of the
characters. Therefore, all two-byte characters are greater than one-byte
chars, independent of the current locale. The return value is zero, greater
than zero or less than zero.
Processed November 7, 1990 MBSTRING(3,L) 2
MBSTRING(3,L) AIX Technical Reference MBSTRING(3,L)
The mbsncmp subroutine is the same as the mbscmp subroutine except that the
comparison is done on nchar characters.
If s does not point to a NULL character, the mblen subroutine returns the
number of bytes in the first multibyte character pointed to by s.
If s points to a NULL character, or to the number of bytes in a valid multibyte
character (consisting of the next n or fewer bytes), mblen returns the value
ZERO; if s points to an invalid multibyte character (consisting of greater than
n bytes), mblen returns the value -1.
The return value of mblen is never greater than n or the value of MB_CUR_MAX,
which is a code-set specific constant that represents the maximum number of
bytes per character.
If mbs is not a NULL pointer, the mbdwidth subroutine determines the display
width of the multibyte character pointed to by mbs. If mbs points to an
invalid multibyte character (that is, a character whose value is greater than
the value of MB_CUR_MAX), mbdwidth returns a value of -1; otherwise, it returns
the display width of the first character. The file code used to define the
multibyte character is specified by the LC_CTYPE or the LC_ALL category of the
locale.
The mbsinvalid subroutine returns a pointer to the byte following the last
valid multibyte character (as specified by LC_CTYPE or LC_ALL) in the string
pointed to by s. If all the characters in the string pointed to by s are valid
multibyte characters, mbsinvalid returns a NULL pointer.
If s is not a NULL pointer, the mbsadvance subroutine returns a pointer to the
next multibyte character (as specified by LC_CTYPE or LC_ALL) in the string
pointed to by s, after skipping the character at the beginning of the string.
RELATED INFORMATION
In this book: "wcstring," "NLstring," "NCstring," "string," "stdlib.h,"
"limits.h," "setlocale," "string.h," and "mbcs.h."
AIX Guide to Multibyte Character Set (MBCS) Support.
Processed November 7, 1990 MBSTRING(3,L) 3