[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

mbsadvance Subroutine

Purpose

Advances to the next multibyte character.

Note
The mbsadvance subroutine is specific to the manufacturer. It is not defined in the POSIX, ANSI, or X/Open standards. Use of this subroutine may affect portability.

Library

Standard C Library (libc.a)

Syntax

#include <mbstr.h>


char *mbsadvance ( S)
const char *S;

Description

The mbsadvance subroutine locates the next character in a multibyte character string. The LC_CTYPE category affects the behavior of the mbsadvance subroutine.

Parameters

S Contains a multibyte character string.

Return Values

If the S parameter is not a null pointer, the mbsadvance subroutine returns a pointer to the next multibyte character in the string pointed to by the S parameter. The character at the head of the string pointed to by the S parameter is skipped. If the S parameter is a null pointer or points to a null string, a null pointer is returned.

Examples

To find the next character in a multibyte string, use the following:

#include <mbstr.h>
#include <locale.h>
#include <stdlib.h>

main()
{
   char *mbs, *pmbs;
   (void) setlocale(LC_ALL, "");
   /*
   ** Let mbs point to the beginning of a multi-byte string.
   */
   pmbs = mbs;
   while(pmbs){
      pmbs = mbsadvance(mbs);
      /* pmbs points to the next multi-byte character
      ** in mbs */
}

Related Information

The mbsinvalid (mbsinvalid Subroutine) subroutine.

Subroutines, Example Programs, and Libraries in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

National Language Support Overview in AIX 5L Version 5.2 National Language Support Guide and Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]