Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mbstring(3x) — HP-UX C++ A.03.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

multibyte(3C)

setlocale(3C)

string(3C)

stringx(3X)

 

NAME

mbstring − multi-byte character string operations: mbslen, mbschr, mbsrchr, mbsmbs, mbsrmbs

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);
char *mbsmbs(char *str, const char *substr);
char *mbsrmbs(char *str, const char *substr);
const char *mbschr(const char *str, wchar_t ch);
const char *mbsrchr(const char *str, wchar_t ch);
const char *mbsmbs(const char *str, const char *substr);
const char *mbsrmbs(const char *str, const char *substr);
 /∗ functions available from C and ANSI C only ∗/
char *mbschr(const char *str, wchar_t ch);
char *mbsrchr(const char *str, wchar_t ch);
char *mbsmbs(const char *str, const char *substr);
char *mbsrmbs(const char *str, const char *substr);
 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. 

mbsmbs

mbsmbs is the equivalent of strstr(3C). mbsmbs returns a pointer to the first occurence of the string substr in the string str, or a NULL pointer if substr does not occur in the string.  If substr points to a string of zero length, mbsmbs returns str.

mbsrmbs

This behaves just like mbsmbs except that it returns the last occurrene of the substr within str. NULL is returned if there is no match. If substr points to a string of zero length, mbsrmbs returns a pointer to the end of str.

NOTES

Supports ANSI-C multibyte characters. 

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), strrchr(3C), and strstr(3C).

SEE ALSO

multibyte(3C), setlocale(3C), string(3C), stringx(3X).

  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026