[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

mbswidth Subroutine

Purpose

Determines the number of multibyte character string display columns.

Note: The mbswidth subroutine is specific to this 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>
int mbswidth (MbStringNumber)
const char *MbString;
size_t Number;

Description

The mbswidth subroutine determines the number of display columns required for a multibyte character string.

Parameters

MbString Contains a multibyte character string.
Number Specifies the number of bytes to read from the s parameter.

Return Values

The mbswidth subroutine returns the number of display columns that will be occupied by the MbString parameter if the number of bytes (specified by the Number parameter) read from the MbString parameter form valid multibyte characters. If the MbString parameter points to a null character, a value of 0 is returned. If the MbString parameter does not point to valid multibyte characters, -1 is returned. If the MbString parameter is a null pointer, the behavior of the mbswidth subroutine is unspecified.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The wcswidth subroutine, wcwidth subroutine.

National Language Support Overview for Programming in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]