示例#1
0
/* Determine number of column positions required for first N wide
   characters (or fewer if S ends before this) in S.  */
int
wcswidth (const wchar_t *s, size_t n)
{
  int result = 0;

  while (n-- > 0 && *s != L'\0')
    {
      int now = internal_wcwidth (*s);
      if (now == -1)
	return -1;
      result += now;
      ++s;
    }

  return result;
}
示例#2
0
/* Determine number of column positions required for CH.  */
int
wcwidth (wchar_t ch)
{
  return internal_wcwidth (ch);
}
/* Determine number of column positions required for CH.  */
int
wcwidth (wint_t ch)
{
  return internal_wcwidth (ch);
}