*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> wcswidth (3)              
Title
Content
Arch
Section
 

wcswidth(3)

Contents


NAME    [Toc]    [Back]

       wcswidth  -  Determine the display width of wide-character
       strings

SYNOPSIS    [Toc]    [Back]

       #include <wchar.h>

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

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces 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.

PARAMETERS    [Toc]    [Back]

       Contains a pointer to the wide-character  string.   Specifies
  the  maximum number of wide characters whose display
       width is to be determined.

DESCRIPTION    [Toc]    [Back]

       The wcswidth() function determines the number  of  display
       columns  to  be  occupied by the number of wide characters
       specified by the n parameter 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.

RETURN VALUES    [Toc]    [Back]

       The 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.

EXAMPLES    [Toc]    [Back]

       The 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  widecharacter
  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.
                 */      } }

SEE ALSO    [Toc]    [Back]

      
      
       Functions: mblen(3), wcslen(3), wcwidth(3)

       Standards: standards(5)



                                                      wcswidth(3)
[ Back ]
 Similar pages
Name OS Title
wcwidth Tru64 Determine the display width of wide characters
iswctype Tru64 Determine the properties of a wide character
wcwidth Linux determine columns needed for a wide character
wcslen Linux determine the length of a wide-character string
wcsncat Linux concatenate two wide-character strings
wcscmp Linux compare two wide-character strings
wcscat Linux concatenate two wide-character strings
wcscmp Tru64 Perform operations on wide-character strings
wcstok_r Tru64 Split wide-character strings into tokens
wcscat Tru64 Perform operations on wide-character strings
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service