Query: wcswidth
OS: osf1
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
wcswidth(3) Library Functions Manual wcswidth(3)NAMEwcswidth - Determines the display width of wide-character stringsLIBRARYStandard C Library (libc)SYNOPSIS#include <wchar.h> int wcswidth( const wchar_t *pwcs, size_t n);STANDARDSInterfaces documented on this reference page conform to industry standards as follows: wcswidth(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags.PARAMETERSContains a pointer to the wide-character string. Specifies the maximum number of wide characters whose display width is to be determined.DESCRIPTIONThe wcswidth() function determines the number of display columns to be occupied by the number of wide characters specified by the n parame- ter in the string pointed to by the pwcs parameter. The behavior of the wcswidth() function is affected by the LC_CTYPE category. Fewer than the number of wide characters specified by the n parameter are counted if a null wide character is encountered first.EXAMPLESThe following example finds the display column width of a wide-character string: #include <wchar.h> #include <locale.h> main() { wchar_t *pwcs; int retval, n ; (void)setlocale(LC_ALL, ""); /* Let pwcs point to a wide-character null-terminated ** string. Let n be the number of wide characters whose ** display column width is to be determined. */ retval= wcswidth( pwcs, n ); if(retval == -1){ /* Error handling. Invalid wide-character code ** encountered in the wide-character string pwcs. */ } }RETURN VALUESThe wcswidth() function returns the number of display columns to be occupied by the specified number of wide characters or (if a null wide character is encountered first) by the number of wide characters encountered before the null. The function returns a value of 0 (zero) if the pwcs parameter is a null pointer or a pointer to a null pointer (that is, if either pwcs or *pwcs is null. The function returns -1 if the pwcs parameter points to a nonprinting wide character.RELATED INFORMATIONFunctions: mblen(3), wcslen(3), wcwidth(3) Standards: standards(5) delim off wcswidth(3)
Related Man Pages |
---|
wcswidth(3p) - centos |
wcswidth(3p) - posix |
mbstowcs(3) - osf1 |
wcstok_r(3) - osf1 |
wcstombs(3c) - sunos |
Similar Topics in the Unix Linux Community |
---|
Max_io_size |
Cannot replace null with space |