man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

wcswidth(3C)

Name

wcswidth - number of column positions of a wide-character string

Synopsis

#include <wchar.h>

int wcswidth(const wchar_t *pwcs, size_t n);

Description

The wcswidth() function determines the number of column positions required for n wide-character codes (or fewer than n wide-character codes if a null wide-character code is encountered before n wide-character codes are exhausted) in the string pointed to by pwcs.

Return Values

The wcswidth() function either returns 0 (if pwcs points to a null wide-character code), or returns the number of column positions to be occupied by the wide-character string pointed to by pwcs, or returns −1 (if any of the first n wide-character codes in the wide-character string pointed to by pwcs is not a printing wide-character code).

Errors

No errors are defined.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
CSI
Enabled
Interface Stability
Committed
MT-Level
MT-Safe with exceptions
Standard

See Also

setlocale(3C), wcwidth(3C), attributes(5), standards(5)